4 ms·
I had a surprise with sorting in JavaScript a few days ago, details also on SO.[0] TL;DR: Chrome uses quick sort and we managed to hit its worst case by pre-or
by cimi_ 9y ago
I had a surprise with sorting in JavaScript a few days ago, details also on SO.[0]
TL;DR: Chrome uses quick sort and we managed to hit its worst case by pre-ordering the input alphabetically on the server side.
[0] https://stackoverflow.com/questions/46228556/how-is-array-sort-performance-affected-by-the-initial-ordering-of-the-input https://stackoverflow.com/questions/46228556/how-is-array-so...