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
var data = [];
for(var i = 0; i < 10000; i++)
{
data.push(Math.floor(Math.random() * 16777215).toString(16));
}
function hexToRgb1(hex) {
var bigint = parseInt(hex, 16);
var r = (bigint >> 16) & 255;
var g = (bigint >> 8) & 255;
var b = bigint & 255;
return [r, g, b];
}
function hexToRgb2(hex) {
var raw = parseInt(hex, 16);
return [(raw >> 16) & 255, (raw >> 8) & 255, raw & 255];
}
function hexToRgb3(hex) {
raw = parseInt(hex, 16);
return [(raw >> 16) & 255, (raw >> 8) & 255, raw & 255];
}
function hexToRgb4(hex) {
return 5;
}
Ready to run.
Test | Ops/sec | |
---|---|---|
hexToRgb1 |
| ready |
hexToRgb2 |
| ready |
hexToRgb3 |
| ready |
hexToRgb4 |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.