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>
/*just a sample function so we have something custom properties can be attached to*/
var cache1 = {};
var cache2 = [];
var cache3 = function (){};
cache3.cache = {};
var $cache4 = function(){
this.cache = {};
};
$cache4.prototype.set = function(i, val){ this.cache[i] = val; };
$cache4.prototype.get = function(i){ return this.cache[i]; };
var cache4 = new $cache4();
var cache5 = (function(){
var cache = {};
return {
set: function(i, val){ return cache[i] = val; },
get: function(i){ return cache[i]; },
cache: cache
}
}());
var cache6 = new function(){
this.cache = {};
return {
set: function(i, val){ return this.cache[i] = val; },
get: function(i){ return this.cache[i]; },
cache: this.cache
}
}();
var cache7 = new function(){
var $this = this;
$this.cache = {};
return {
set: function(i, val){ return $this.cache[i] = val; },
get: function(i){ return $this.cache[i]; },
cache: $this.cache
}
}();
var cache8 = (function(){
var cache = {};
return {
set: function(i, val){ return this.cache[i] = val; },
get: function(i){ return this.cache[i]; },
cache: this.cache
}
}());
var $cache9 = function $cache9(){};
$cache9.prototype.cache = {};
$cache9.prototype.set = function(i, val){ this.cache[i] = val; };
$cache9.prototype.get = function(i){ return this.cache[i]; };
var cache9 = new $cache9();
var cache10 = new function(){
this.set = function(key, val){ this[key] = val; };
this.get = function(key){ return this[key]; };
return this;
}();
var cache11 = function(){};
cache11.set = function(key, val){ this[key] = val; };
cache11.get = function(key){ return this[key]; };
var cache12 = new function(){
this.cache = {};
this.set = function(i, val){ this.cache[i] = val; };
this.get = function(i){ return this.cache[i]; };
return this;
}();
var cache13 = new function(){
this.cache = {};
this.set = function(i, val){ this.cache[i] = val; };
this.get = function(i){ return this.cache[i]; };
return this;
};
</script>
cache1 = {};
cache2 = [];
cache3.cache = {};
cache4.cache = {};
cache5.cache = {};
cache6.cache = {};
cache7.cache = {};
cache8.cache = {};
cache9.cache = {};
//cache10.cache = {};
//cache11.cache = {};
cache12.cache = {};
Ready to run.
Test | Ops/sec | |
---|---|---|
Object Array |
| ready |
Simple Array |
| ready |
Function Properties |
| ready |
Prototype |
| ready |
Module Pattern 1 |
| ready |
Module Pattern 2 |
| ready |
Module Pattern 3 |
| ready |
Module Pattern 4 |
| ready |
Prototype |
| ready |
Function Properties 2 |
| ready |
Function Properties 3 |
| ready |
Function Properties 4 |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.