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 obj
, lib = { x: 1, y: 2 }
, lib2 = { x: 1, y: 2, z: 3 }
, z = 3
, with1 = function(){
with(lib){ return function() {
x += y + z }}}()
, with2 = function() {
with(lib2){ return function() {
x += y + z }}}()
, obj1 = function() {
return function() {
obj.x += obj.y + z }}()
, obj2 = function() {
return function() {
obj.x += obj.y + z }}()
Benchmark.prototype.setup = function() {
lib = { x: 1, y: 2 }
lib2 = { x: 1, y: 2, z: 3 }
obj = { x: 1, y: 2, z: 3 }
};
Ready to run.
Test | Ops/sec | |
---|---|---|
with |
| ready |
no wrapping |
| ready |
with (top-level) |
| ready |
no wrapping (obj-only) |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.