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
var sum = function(a,b){ return a+b; };
var id = 0;
var obj = {
foo: sum,
bar: [{
baz: [["foo", "bar"], "baz", function(){}]
}]
};
function recursive(data) {
if (data && typeof data === "object")
for (var p in data)
if (typeof data[p] === "function")
data[p] = "func" + id++;
else
recursive(data[p]);
return data
}
function viaJSON(data){
return JSON.parse(JSON.stringify(data, function (key, value) {
if (typeof value === "function") {
id++;
return "func"+id;
}
return value;
}));
}
Ready to run.
Test | Ops/sec | |
---|---|---|
recursive |
| ready |
JSON |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.