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";
const CATEGORY_F = "Category F";
const CATEGORY_G = "Category G";
const CATEGORY_H = "Category H";
const CATEGORY_I = "Category I";
const CATEGORY_J = "Category J";
const CATEGORY_K = "Category K";
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";
}
if (category === CATEGORY_F) {
return "Name F";
}
if (category === CATEGORY_G) {
return "Name G";
}
if (category === CATEGORY_H) {
return "Name H";
}
if (category === CATEGORY_I) {
return "Name I";
}
if (category === CATEGORY_J) {
return "Name J";
}
if (category === CATEGORY_K) {
return "Name K";
}
}
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";
LOOKUP_OBJECT[CATEGORY_F] = "Name F";
LOOKUP_OBJECT[CATEGORY_G] = "Name G";
LOOKUP_OBJECT[CATEGORY_H] = "Name H";
LOOKUP_OBJECT[CATEGORY_I] = "Name I";
LOOKUP_OBJECT[CATEGORY_J] = "Name J";
LOOKUP_OBJECT[CATEGORY_K] = "Name K";
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.