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