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
A Flash and C trick ported to JS array buffers. Doesn't look like a gain yet.
There were serious problems in previous revisions, the Quake Inverse SQRT code wasnt returning the correct values. This should correct it.
<script>
var Math_sqrt = Math.sqrt;
var x2 = new Float32Array(1);
var y = new Float32Array(1);
function InvSqrt(number) {
x2[0] = number * 0.5;
y[0] = number;
var threehalfs = 1.5;
var i = new Int32Array(y.buffer);
i[0] = 0x5f3759df - (i[0] >> 1);
y = new Float32Array(i.buffer);
y[0] = y[0] * (threehalfs - (x2[0] * y[0] * y[0]));
return y[0];
}
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
Classic |
| ready |
Quake inverse sqrt |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.