3 ms·
Yep, the Comprehension is faster in all the environments I tested: Chrome 28.0.1500.71 on OS X 10.8.4 (map is 54% slower) Safari 6.0.5 on OS X 10.8.4 (map is
by Kerrick 13y ago
Yep, the Comprehension is faster in all the environments I tested:
Chrome 28.0.1500.71 on OS X 10.8.4 (map is 54% slower)
Safari 6.0.5 on OS X 10.8.4 (map is 28% slower)
Firefox 23.0 on OS X 10.8.4 (map is 62% slower)*
Opera 12.16 on OS X 10.8.4 (map is 72% slower)
IE 10.0 on Windows 7 [via VirtualBox] (map is 42% slower)
And testing the same via a node.js benchmark it says the fastest is comprehension. https://gist.github.com/Kerrick/cff3d1212c82bc804712 https://gist.github.com/Kerrick/cff3d1212c82bc804712
* Every time I load the JSPerf page on Firefox, the first run the two tests are on par, and the second (and following) runs I get map being much slower. I have to wonder if the JS engine begins optimizing the comprehension version at some point.