I've been working with a client on her Shopify store. She's trying to order the classes she sells by date. Makes sense, right? But that's not really how Shopify is set up, so my first attempt was to use a bubble sort with the Shopify logic. It worked like a champ in my test cases because I was using 6 classes. The video below pretty accurately demonstrates what the code looked like and about how long it took to render.
In the real world, she's starting off with 58 classes. All the nested loops required for the sorting algorithm generated (are you ready?) over 800,000 lines of html, which obviously took a hot minute for the browser to render. I tried simplifying the code, but I couldn't reduce that by more than 20% -- still waaaay too massive.
It's an upgrade from Hungarian folk dance to Step Up Revolution.