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
In V8, integers over 31 bits are represented as floats.
<script type="text/javascript">
var bits = [0];
for (var i = 1; i < 34; i++)
bits[i] = 1 << (i - 1);
// These function calls prevent V8 from performing trivial optimizations
// that would otherwise hide the threshold
var getBits = function (i) {
return bits[i];
};
var subtract = function (lhs, rhs) {
return lhs - rhs;
};
var count = 5000;
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
Subtract 30-bit integers |
| ready |
Subtract 31-bit integers |
| ready |
Subtract 32-bit integers |
| ready |
Subtract 33-bit integers |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.