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
<script src="//ajax.googleapis.com/ajax/libs/prototype/1.6.1.0/prototype.js"></script>
<script>
var a = 'test',
x;
function isValueInArray(arr, val) {
inArray = false;
for (i = 0; i < arr.length; i++) {
if (val === arr[i]) {
inArray = true;
}
}
return inArray;
}
function oc(a) {
var o = {};
for (var i = 0; i < a.length; i++) {
o[a[i]] = '';
}
return o;
}
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
Or |
| ready |
switch / case |
| ready |
In Object |
| ready |
isValueInArray |
| ready |
Object Converter / In |
| ready |
Regex |
| ready |
Ternary |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.