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="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.13.6/underscore-min.js"></script>const values = [];
for (let i = 0; i < 500; i++) {
values.push(i);
values.push('string_' + i);
values.push(i % 2 === 0);
}
const existingNumber = 250;
const existingString = 'string_100';
const existingBoolean = true;
const missingNumber = 9999;
const missingString = 'not_in_array';
// Rotate through different search values to test various scenarios
const searchTargets = [existingNumber, existingString, existingBoolean, missingNumber, missingString];
let currentIndex = 0;
let searchValue = searchTargets[currentIndex]currentIndex = (currentIndex + 1) % searchTargets.length;
searchValue = searchTargets[currentIndex];Ready to run.
| Test | Ops/sec | |
|---|---|---|
| _.contains | | ready |
| .includes | | ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.