|
|
|
|
|
by brown9-2
6059 days ago
|
|
But just stating why a more performant option exists doesn't tell us how much performance you'll squeeze out just by making this change. In other words, it's not very helpful to say "this is so slow, you should do this instead" without at least trying to quantify the difference somehow. |
|
With 10M entries in the array, the "slow" way takes 509 ms and the "faster" way takes 362 ms. So we can save roughly 15 nanoseconds per iteration. Or a 30% speedup - assuming nothing happens inside the loop.
(Of course the numbers may vary wildly per browser.)
Somehow I doubt this is the performance problem behind slow web pages.