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
Compares two options for console log formatting.
function ts() {
var d = new Date();
var hrs = '' + d.getHours();
var min = '' + d.getMinutes();
var sec = '' + d.getSeconds();
var mil = '' + d.getMilliseconds();
var pad2 = '00';
var pad3 = '000';
var str =
pad2.substring(0, pad2.length - hrs.length) + hrs + ':' +
pad2.substring(0, pad2.length - min.length) + min + ':' +
pad2.substring(0, pad2.length - sec.length) + sec + '.' +
pad3.substring(0, pad3.length - mil.length) + mil + ': ';
return str;
}
function logFormat(loc, txt) {
return ts() + txt + ' [' + loc + ']';
}
Ready to run.
Test | Ops/sec | |
---|---|---|
Console with Printf |
| ready |
Console with logFormat |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.