Re:Show HN: Fast.js – faster reimplementations of native Jav...
by jrajav on Tuesday June 24, 2014 @10:57AM
(#7938101)
Here's a jsperf of fast.js / lodash / native: http://jsperf.com/fast-vs-lodash
[ Parent
| on HN ]
Re:Show HN: Fast.js – faster reimplementations of native Jav...
by bzbarsky on Tuesday June 24, 2014 @01:38PM
(#7939092)
Thanks for that.
So looking at this in Firefox, the "fast" version underperforms the native one for forEach, bind, map, reduce, and concat. It outperforms native for indexOf/lastIndexOf.
In Chrome the "fast" version does better than the native one for indexOf, lastIndexOf, forEach, map, and reduce. It does worse on bind and concat.
It's interesting to compare the actual numbers across the browsers too. In Firefox, the numbers I see for forEach are:
"fast": 47,688
native: 123,187
and the Chrome ones are: "fast": 71,070
native: 20,112
Similarly, for map in Firefox I see: "fast": 17,532
native: 62,268
and in Chrome: "fast": 38,286
native: 19,521
Interestingly, these two methods are actually implemented in self-hosted JS in both SpiderMonkey and V8, last I checked, so this is really comparing the performance of three different JS implementations.
Re:Show HN: Fast.js – faster reimplementations of native Jav...
by cel1ne on Wednesday June 25, 2014 @05:11AM
(#7942909)
Native bind in Safari is much faster.
bind - fast 2,565,227 ±2.19%
bind - lodash 4,923,373 ±1.51%
bind - native 9,022,396 ±2.12%
on iPad this difference is even larger.
Re:Show HN: Fast.js – faster reimplementations of native Jav...
by megawac on Tuesday June 24, 2014 @12:34PM
(#7938654)
Fixed the rawgit link to use the rawgit cdn
Re:Show HN: Fast.js – faster reimplementations of native Jav...
by phpnode on Tuesday June 24, 2014 @11:03AM
(#7938131)
thanks for this! it looks like there's some room for improvement in the .map / .forEach implementations but the rest seems to stack up pretty well.