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 a(status) {
switch (status) {
case 'pack':
case 'sweater':
case 'macabre':
case 'record':
case 'grain':
case 'seashore':
case 'cynical':
case 'ticket':
case 'hapless':
case 'number':
case 'colossal':
case 'curious':
case 'doubt':
case 'inject':
case 'erratic':
case 'courageous':
case 'drip':
case 'mundane':
case 'dark':
case 'nutty':
case 'trust':
case 'obscene':
case 'decorate':
case 'verdant':
case 'needle':
case 'utopian':
case 'cake':
case 'daughter':
case 'mighty':
case 'frame':
case 'steep':
case 'fill':
case 'aboard':
case 'bright':
case 'coordinated':
case 'command':
case 'taboo':
case 'adjustment':
case 'pray':
case 'telephone':
case 'flow':
case 'use':
case 'stop':
case 'disarm':
case 'press':
case 'statement':
case 'nod':
case 'icy':
case 'gray':
case 'puncture':
case 'north':
case 'unequaled':
case 'scared':
case 'spoil':
case 'scattered':
case 'letter':
case 'eggs':
case 'skirt':
case 'protect':
case 'belligerent':
case 'marvelous':
case 'magical':
case 'offbeat':
case 'clammy':
case 'fearful':
case 'direction':
case 'parsimonious':
case 'childlike':
case 'flaky':
case 'disastrous':
case 'lock':
case 'nose':
case 'bells':
case 'scatter':
case 'jump':
case 'button':
case 'brawny':
case 'crush':
case 'skinny':
case 'haunt':
case 'box':
case 'ear':
case 'ugly':
case 'slimy':
case 'snakes':
case 'mother':
case 'special':
case 'vessel':
case 'unable':
case 'hungry':
case 'vacuous':
case 'mouth':
case 'undress':
case 'false':
case 'fertile':
case 'free':
case 'event':
case 'pass':
case 'delightful':
case 'highfalutin':
return true
}
}
function b(status) {
if (
status == 'pack' ||
status == 'sweater' ||
status == 'macabre' ||
status == 'record' ||
status == 'grain' ||
status == 'seashore' ||
status == 'cynical' ||
status == 'ticket' ||
status == 'hapless' ||
status == 'number' ||
status == 'colossal' ||
status == 'curious' ||
status == 'doubt' ||
status == 'inject' ||
status == 'erratic' ||
status == 'courageous' ||
status == 'drip' ||
status == 'mundane' ||
status == 'dark' ||
status == 'nutty' ||
status == 'trust' ||
status == 'obscene' ||
status == 'decorate' ||
status == 'verdant' ||
status == 'needle' ||
status == 'utopian' ||
status == 'cake' ||
status == 'daughter' ||
status == 'mighty' ||
status == 'frame' ||
status == 'steep' ||
status == 'fill' ||
status == 'aboard' ||
status == 'bright' ||
status == 'coordinated' ||
status == 'command' ||
status == 'taboo' ||
status == 'adjustment' ||
status == 'pray' ||
status == 'telephone' ||
status == 'flow' ||
status == 'use' ||
status == 'stop' ||
status == 'disarm' ||
status == 'press' ||
status == 'statement' ||
status == 'nod' ||
status == 'icy' ||
status == 'gray' ||
status == 'puncture' ||
status == 'north' ||
status == 'unequaled' ||
status == 'scared' ||
status == 'spoil' ||
status == 'scattered' ||
status == 'letter' ||
status == 'eggs' ||
status == 'skirt' ||
status == 'protect' ||
status == 'belligerent' ||
status == 'marvelous' ||
status == 'magical' ||
status == 'offbeat' ||
status == 'clammy' ||
status == 'fearful' ||
status == 'direction' ||
status == 'parsimonious' ||
status == 'childlike' ||
status == 'flaky' ||
status == 'disastrous' ||
status == 'lock' ||
status == 'nose' ||
status == 'bells' ||
status == 'scatter' ||
status == 'jump' ||
status == 'button' ||
status == 'brawny' ||
status == 'crush' ||
status == 'skinny' ||
status == 'haunt' ||
status == 'box' ||
status == 'ear' ||
status == 'ugly' ||
status == 'slimy' ||
status == 'snakes' ||
status == 'mother' ||
status == 'special' ||
status == 'vessel' ||
status == 'unable' ||
status == 'hungry' ||
status == 'vacuous' ||
status == 'mouth' ||
status == 'undress' ||
status == 'false' ||
status == 'fertile' ||
status == 'free' ||
status == 'event' ||
status == 'pass' ||
status == 'delightful' ||
status == 'highfalutin'
) {
return true
}
}
function c(status) {
if (['pack', 'sweater', 'macabre', 'record', 'grain', 'seashore', 'cynical', 'ticket', 'hapless', 'number', 'colossal', 'curious', 'doubt', 'inject', 'erratic', 'courageous', 'drip', 'mundane', 'dark', 'nutty', 'trust', 'obscene', 'decorate', 'verdant', 'needle', 'utopian', 'cake', 'daughter', 'mighty', 'frame', 'steep', 'fill', 'aboard', 'bright', 'coordinated', 'command', 'taboo', 'adjustment', 'pray', 'telephone', 'flow', 'use', 'stop', 'disarm', 'press', 'statement', 'nod', 'icy', 'gray', 'puncture', 'north', 'unequaled', 'scared', 'spoil', 'scattered', 'letter', 'eggs', 'skirt', 'protect', 'belligerent', 'marvelous', 'magical', 'offbeat', 'clammy', 'fearful', 'direction', 'parsimonious', 'childlike', 'flaky', 'disastrous', 'lock', 'nose', 'bells', 'scatter', 'jump', 'button', 'brawny', 'crush', 'skinny', 'haunt', 'box', 'ear', 'ugly', 'slimy', 'snakes', 'mother', 'special', 'vessel', 'unable', 'hungry', 'vacuous', 'mouth', 'undress', 'false', 'fertile', 'free', 'event', 'pass', 'delightful', 'highfalutin'].includes(status)) {
return true
}
}
let x = ['pack', 'sweater', 'macabre', 'record', 'grain', 'seashore', 'cynical', 'ticket', 'hapless', 'number', 'colossal', 'curious', 'doubt', 'inject', 'erratic', 'courageous', 'drip', 'mundane', 'dark', 'nutty', 'trust', 'obscene', 'decorate', 'verdant', 'needle', 'utopian', 'cake', 'daughter', 'mighty', 'frame', 'steep', 'fill', 'aboard', 'bright', 'coordinated', 'command', 'taboo', 'adjustment', 'pray', 'telephone', 'flow', 'use', 'stop', 'disarm', 'press', 'statement', 'nod', 'icy', 'gray', 'puncture', 'north', 'unequaled', 'scared', 'spoil', 'scattered', 'letter', 'eggs', 'skirt', 'protect', 'belligerent', 'marvelous', 'magical', 'offbeat', 'clammy', 'fearful', 'direction', 'parsimonious', 'childlike', 'flaky', 'disastrous', 'lock', 'nose', 'bells', 'scatter', 'jump', 'button', 'brawny', 'crush', 'skinny', 'haunt', 'box', 'ear', 'ugly', 'slimy', 'snakes', 'mother', 'special', 'vessel', 'unable', 'hungry', 'vacuous', 'mouth', 'undress', 'false', 'fertile', 'free', 'event', 'pass', 'delightful', 'highfalutin']
function d(status) {
if (x.includes(status)) {
return true
}
}
Ready to run.
Test | Ops/sec | |
---|---|---|
a - switch |
| ready |
b - || |
| ready |
c - array.includes |
| ready |
d - cached array.includes |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.