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 f = function(obj, step){
return obj.x + obj.y + step;
}
var K = 50;
var objs = [];
for (var i = 0; i < K; i++) {
objs.push(new function () {
this.y = 0;
this.x = 0;
} ());
}
var mono = [],
poly = [],
poly2 = [],
mega = [];
var N = 20;
for (var i = 0; i < N; i++) {
mono.push(objs[0])
poly.push(objs[i % 3])
poly2.push(objs[(i % 3) || (K / 2)])
mega.push(objs[i % 6])
}
var result = 0;
if (result < 0) throw "";
Ready to run.
Test | Ops/sec | |
---|---|---|
calling monomorphic function |
| ready |
calling polymorphic |
| ready |
calling megamorphic |
| ready |
poly (different property offsets) |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.