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
const str = `asdf+π±πΆππΉπ°π¦π»πΌπ¨π―`.repeat(10000);
const segmenter = new Intl.Segmenter('en', { granularity: 'grapheme' });
function arrFrom(str) {
return Array.from(str);
}
function spreadFrom(str) {
return [...str];
}
function native(str) {
return [...segmenter.segment(str)].length;
}
function native2(str) {
return [...new Intl.Segmenter('en', { granularity: 'grapheme' }).segment(str)]
}
Ready to run.
Test | Ops/sec | |
---|---|---|
Array.from |
| ready |
Spread |
| ready |
native |
| ready |
native2 |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.