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>
var globalConst1 = new Float32Array([1]);
var global1 = 1;
function makeConstClosure(n) {
var value = new Float32Array([n]);
return function(n) {
value[0] = n
return value[0]
}
}
var cc1 = makeConstClosure(1);
function makeVarClosure(n) {
var value = n;
return function(n) {
value = n;
return value
}
}
var vc1 = makeVarClosure(1);
var gcc1 = function(n) {
globalConst1[0] = n
return globalConst1[0]
};
var gvc1 = function(n) {
global1 = n
return global1
};
var count = 5000;
</script>Ready to run.
| Test | Ops/sec | |
|---|---|---|
| float | | ready |
| var | | ready |
| global float | | ready |
| global var | | ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.