Post

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 reposts0 likes

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.