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 y = new Float32Array(1);
var i = new Int32Array(y.buffer);
function InvSqrt(number) {
var x2 = number * 0.5;
y[0] = number;
var threehalfs = 1.5;
i[0] = 0x5f3759df - (i[0] >> 1);
var number2 = y[0];
return number2 * (threehalfs - (x2 * number2 * number2));
}
</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.