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
Comparation between string.localeCompare(string, undefined, {sensitivity: 'base'}) and string.toLowerCase().localeCompare(string.toLowerCase())
function generateRandomString(length) {
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
let result = '';
for (let i = 0; i < length; i++) {
result += characters.charAt(Math.floor(Math.random() * characters.length));
}
return result;
}
const arrayData = Array.from({ length: 120 }, () => ({
text: generateRandomString(Math.floor(Math.random() * (30 - 15 + 1)) + 15)
}));
Ready to run.
Test | Ops/sec | |
---|---|---|
array sort with localeCompare / sensivity:base |
| ready |
array sort with localeCompare / toLowerCase |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.