Hugo @codewithhugo.com · Feb 25

This fix for an O(n^2) -> O(n) is just moving a reduce() out of a map(), but it took years to diagnose (thanks to showsubmit.com for being the reproduction case).

0 likes 1 replies

?

Replies

Hugo · Feb 25

Quadratic runtime complexity (nested loops) is really nasty since it's fast over small datasets/test cases but under real-world usage it breaks. In this case, the Alpine.js Devtools data panel would freeze.