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 type="module">
import stringify from 'https://cdn.jsdelivr.net/npm/json-stable-stringify@1.1.1/+esm';
window.stringify = stringify;
</script>
<script type="module">
import { Md5 } from 'https://cdn.jsdelivr.net/npm/ts-md5@1.3.1/+esm';
window.Md5 = Md5;
</script>
<script type="module">
import { dequal } from 'https://cdn.jsdelivr.net/npm/dequal@2.0.3/lite/index.mjs';
window.deepEqual = dequal;
</script>
const obj1 = Array.from({ length: 100 }).reduce(
o => ({ bbbbbbb: '11111111', cccccc: '111111111', aaaaaaa: o }),
{}
);
const obj2 = Array.from({ length: 100 }).reduce(
o => ({ bbbbbbb: '11111111', cccccc: '111111111', aaaaaaa: o }),
{}
);
function createHash(obj) {
function replacer(key, value) {
if (value instanceof RegExp) return '__REGEXP ' + value.toString();
else return value;
}
return Md5.hashStr(stringify(obj, { replacer }));
}
Ready to run.
Test | Ops/sec | |
---|---|---|
deep Equal |
| ready |
compare hashes |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.