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
This test compares to common alternatives when trying to find out if a given item is part of a list.
To read the results, compare each "pair" of tests, i.e. "String success" vs. "array success", then "String fail" vs. "Array fail" and so on.
<script>
var str = " Lorizzle go to hizzle ass sit fo shizzle, sure adipiscing break yo neck, yall. Nullam sapien shiznit, we gonna chung volutpizzle, suscipit pimpin', gravida boom shackalack, arcu. The bizzle pizzle black. Boofron erizzle. For sure izzle brizzle dapibizzle that's the shizzle tempus fo shizzle my nizzle. Maurizzle dope nibh izzle hizzle. Fizzle izzle you son of a bizzle. Pellentesque shit daahng dawg nisi. In boofron platea dictumst. Donec dapibizzle. Fo shiznit, pretizzle funky fresh, mattizzle ac, eleifend vitae, nunc. I saw beyonces tizzles and my pizzle went crizzle suscipit. Integizzle owned velizzle sed purus. ";
var arr = str.trim().split(" ");
var toFind = "izzle";
var toFail = "uzzle";
// short version
var arrShort = ["foo", "bar", "baz"];
var strShort = " foo bar baz ";
var toFindShort = "bar"
var toFailShort = "boo";
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
String success |
| ready |
Array success |
| ready |
String fail |
| ready |
Array fail |
| ready |
Short String success |
| ready |
Short Array success |
| ready |
Short String fail |
| ready |
Short Array fail |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.