4 ms·
I agree with the author that performance optimizations for the vast majority of the code we're writing are usually not addressing significant bottlenecks, but t
by ralusek 9y ago
I agree with the author that performance optimizations for the vast majority of the code we're writing are usually not addressing significant bottlenecks, but they should still include benchmarks.
I put them here:
https://jsperf.com/advancedweb-test/1 https://jsperf.com/advancedweb-test/1
The for loop executes 20.64x faster in V8.
Again, I think that iterator functions are great and should definitely be used, but it's important to know the cost.
- dpcx 9y agoHow much of that is because the collection based prime detector has to perform the calculation for every item in the array, even after it's gotten to the 10th item?