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
why [] is slower than charAt (with smaller strings than in the first tests)
var s = '', ok = ' h dfb ds84 78sgf ydf hjb////**', lc = 0, cc = 0
for (var i = 0; i < 3000; i++) {
s += ok[Math.floor(Math.random() * ok.length)]
}
var so = new String(s);
console.log(lc, cc)
Ready to run.
Test | Ops/sec | |
---|---|---|
property access on primitive |
| ready |
charAt on primitive |
| ready |
property access on object |
| ready |
charAt on object |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.