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
testing json key locate vs switch case vs object literals
const interviewTypeToSubTypeMap = {
'remote': 'Reminder2',
'remote2': 'Reminder2',
'phone': 'Reminder3',
'phone2': 'Reminder3',
'in-person': 'Reminder1',
'in-person2': 'Reminder1',
};
function isInPerson () {
return 'Reminder1';
}
function isRemote () {
return 'Reminder2';
}
function isPhone () {
return 'Reminder3';
}
const interviewTypeToSubTypeLiteral = {
'remote': isRemote,
'remote2': isRemote,
'phone': isPhone,
'phone2': isPhone,
'in-person': isInPerson,
'in-person2': isInPerson
};
Ready to run.
Test | Ops/sec | |
---|---|---|
json key locate |
| ready |
switch case |
| ready |
object literal |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.