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
In trying to find if a string contains a substring, is it faster to use a logical comparison or bitwise operations to create a logical result.
http://dreaminginjavascript.wordpress.com/2008/07/04/28/
Note: this test will most likely cause Interget Explorer to display a script timeout message so adjust your registry settings accordingly.
var alphabet = "abcdefghijklmnopqrstuvwxyz";
var index = alphabet.indexOf("l");
var noindex = alphabet.indexOf("1");
Ready to run.
Test | Ops/sec | |
---|---|---|
Logical Greater Than |
| ready |
Bitwise NOT |
| ready |
Logical Not Equals |
| ready |
Logical Strict Not Equals |
| ready |
Add One |
| ready |
Logical Greater Than (Not Found) |
| ready |
Bitwise NOT (Not Found) |
| ready |
Logical Not Equals (Not Found) |
| ready |
Logical Strict Not Equals (Not Found) |
| ready |
Add One (Not Found) |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.