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
I want a simple check for JSON-likely strings, so i just check for curly braces at the beginning and end of string.
*Updated to use a variable for str.length
<script>
var str = '{"remark":"Done it today","destination":"2727273232","associated_id":19202,"associated_type":"Thingy"}',
strLen = str.length - 1;
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
indexOf |
| ready |
Regex |
| ready |
charAt |
| ready |
lastIndexOf |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.