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
<script src="//raw.github.com/bestiejs/lodash/v0.9.1/lodash.js"></script>
<script>lodash = _.noConflict();</script>
<script src="//underscorejs.org/underscore.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script>
$.mapObj = function(array, key, groupElements, existing) {
var map = existing || {}, i, length = array.length;
if (key) {
if (groupElements) {
for (i = 0; i < length; ++i) {
if (!map[array[i][key]]) map[array[i][key]] = [array[i]];
else map[array[i][key]].push(array[i]);
}
} else {
for (i = 0; i < length; ++i) {
map[array[i][key]] = array[i];
}
}
} else {
for (i = 0; i < length; ++i) {
map[array[i]] = true;
}
}
return map;
};
var bigArray = [];
for (var i = 0; i < 500; ++i) {
bigArray.push({id: i, ten: i % 10, hundred: 1 % 100})
}
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
underscore |
| ready |
custom non grouping |
| ready |
custom grouping |
| ready |
lodash |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.