jsPerf.app is an online JavaScript performance benchmark test runner & jsperf.com mirror. It is a complete rewrite in homage to the once excellent jsperf.com now with hopefully a more modern & maintainable codebase.
jsperf.com URLs are mirrored at the same path, e.g:
https://jsperf.com/negative-modulo/2
Can be accessed at:
https://jsperf.app/negative-modulo/2
How Lazy.js compares to Underscore/Lodash
<script src="//rawgithub.com/dtao/lazy.js/master/lazy.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.6.0/underscore-min.js"></script>
<script>var underscore = _.noConflict();</script>
<script src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min.js"></script>
<script>var lodash = _.noConflict();</script>
<script>
var data = Lazy.generate(function() {
return {
a: Math.random().toString(36).substring(7),
b: Math.random().toString(36).substring(7),
c: Math.random().toString(36).substring(7),
d: Math.random().toString(36).substring(7),
e: Math.random().toString(36).substring(7),
f: Math.random().toString(36).substring(7),
g: Math.random().toString(36).substring(7),
h: Math.random().toString(36).substring(7),
i: Math.random().toString(36).substring(7),
j: Math.random().toString(36).substring(7),
k: Math.random().toString(36).substring(7),
l: Math.random().toString(36).substring(7),
m: Math.random().toString(36).substring(7),
n: Math.random().toString(36).substring(7)
}
}, 500000).toArray();
function filter1(x) {
return x.a.toLowerCase().startsWith("f");
}
function filter2(x) {
return x.b.toLowerCase().startsWith("f");
}
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
Lazy (filter all records) |
| ready |
Lazy (the first 10 records) |
| ready |
Lodash |
| ready |
Underscore |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.