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
'use strict';
function get_name() {
return this.name;
}
function set_name(name) {
this.name = name;
}
function do_something_useful(n) {
var i,
sum = 0;
for (i = 0; i < n; i += 1) {
sum += i;
}
return sum;
}
function Person(name) {
this.name = name;
}
Person.prototype.get_name = get_name;
Person.prototype.set_name = set_name;
Person.prototype.do_something_useful = do_something_useful;
var person = function(name) {
return {
name: name,
get_name: get_name,
set_name: set_name,
do_something_useful: do_something_useful
};
};
var p = new Person('John');
var c = person('John');
Ready to run.
Test | Ops/sec | |
---|---|---|
Prototype init |
| ready |
Closure init |
| ready |
Prototype read |
| ready |
Closure read |
| ready |
Prototype write |
| ready |
Closure write |
| ready |
Prototype doing useful |
| ready |
Closure doing useful |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.