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>
const globalConst1 = "b";
const globalConstA = "a";
var global1 = "b";
var globalA = "a";
function makeConstClosure(n) {
const value = n;
return function() {
return value;
}
}
var cc1 = makeConstClosure("b");
var cca = makeConstClosure("a");
function makeVarClosure(n) {
var value = n;
return function() {
return value;
}
}
var vc1 = makeVarClosure("b");
var vca = makeVarClosure("a");
var gcc1 = function() {
return globalConst1;
};
var gcca = function() {
return globalConstA;
};
var gvc1 = function() {
return global1;
};
var gvca = function() {
return globalA;
};
var count = 5000;
</script>Ready to run.
| Test | Ops/sec | |
|---|---|---|
| const | | ready |
| var | | ready |
| global const | | ready |
| global var | | ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.