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
perf difference between running a string through .toLowerCase() before applying a regex or just doing it in the regex.
var testString = "iPhone";
var longString = "The rain in spain falls mainly in the plane. She sells sea shells on the sea SHORE."
Ready to run.
Test | Ops/sec | |
---|---|---|
regex |
| ready |
.toLowerCase() first |
| ready |
if already lower case |
| ready |
if already lower case (long string/match) |
| ready |
Long string with regex |
| ready |
Long String toLowerCase |
| ready |
Must form regex in code |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.