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
To generate a slug, do this:
-
)Note that following these steps still won’t turn "ïñtërnâtiônàlizætiøn"
into "internationalization"
. This was not a requirement in this case.
<script>
var arr = [
'This is just a test', // → "this-is-just-a-test"
'Some “weird” characters: ©™® Awesome', // → "some-weird-characters-awesome"
'Lorem ipsum 123 dolor' // → "lorem-ipsum-123-dolor"
];
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
Using 3 .replace()s - case sensitive |
| ready |
Using .match() and .join() - case insensitive |
| ready |
Using 2 .replace()s - case sensitive |
| ready |
Using .match() and .join() - case sensitive |
| ready |
Using 2 .replace()s - case insensitive |
| ready |
Using 3 .replace()s - case insensitive |
| ready |
trim down before lcase |
| ready |
trim ends before inserting hyphens |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.