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
const CATEGORY_A = "Category A";
const CATEGORY_B = "Category B";
const CATEGORY_C = "Category C";
const CATEGORY_D = "Category D";
const CATEGORY_E = "Category E";
function lookupCategoryName(category) {
if (category === CATEGORY_A) {
return "Name A";
}
if (category === CATEGORY_B) {
return "Name B";
}
if (category === CATEGORY_C) {
return "Name C";
}
if (category === CATEGORY_D) {
return "Name D";
}
if (category === CATEGORY_E) {
return "Name E";
}
}
const LOOKUP_OBJECT = {};
LOOKUP_OBJECT[CATEGORY_A] = "Name A";
LOOKUP_OBJECT[CATEGORY_B] = "Name B";
LOOKUP_OBJECT[CATEGORY_C] = "Name C";
LOOKUP_OBJECT[CATEGORY_D] = "Name D";
LOOKUP_OBJECT[CATEGORY_E] = "Name E";
Ready to run.
Test | Ops/sec | |
---|---|---|
Comparison Function |
| ready |
Object Lookup |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.