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
function uuid() {
return ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, c =>
(c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)
);
}
var numIdsToPopulate = 300;
var allIds = Array(numIdsToPopulate).fill().map(() => uuid());
var idsToStore = allIds.slice(0, 150);
var idSet = new Set(idsToStore);
var obj = allIds.reduce((acc, curr) => {
acc[curr] = true;
return acc;
}, {});
Ready to run.
Test | Ops/sec | |
---|---|---|
array search |
| ready |
object search |
| ready |
Set search |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.