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
Test performance of native filter method for arrays vs lodash filter method
<script src="//cdn.rawgit.com/lodash/lodash/54644cda79c7074ff710c73ecab7a8a91d583414/dist/lodash.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/dojo/1.10.0/dojo/dojo.js"></script>
<script src="//underscorejs.org/underscore-min.js"></script>
<script>
var underscore = _.noConflict();
</script>
var a1 = _.range(100);
var a2 = _.union.apply(_, _.times(34, function() {
return [
{ name: 'john', age: 47 },
{ name: 'jane', age: 22 },
{ name: 'bill', age: 60 }
];
}));
var dojoArray = require("dojo/_base/array");
Ready to run.
Test | Ops/sec | |
---|---|---|
lodash filter |
| ready |
Array.filter |
| ready |
filter(fn, thisObj) |
| ready |
dojo filter |
| ready |
for push |
| ready |
underscore filter |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.