Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Object property vs switch with 100 executions
(version: 2)
Dummy benchmark
Comparing performance of:
Object vs Switch
Created:
5 years ago
by:
Registered User
Jump to the latest result
Tests:
Object
var FUNCTIONS = { EMERGENCY: 'EMERGENCY', CRITICAL: 'CRITICAL', ERROR: 'ERROR', ALERT: 'ALERT', WARNING: 'WARNING', NOTICE: 'NOTICE', INFO: 'INFO', DEBUG: 'DEBUG', } function getMethodByObject(method) { return FUNCTIONS[method] } getMethodByObject('NOTICE') getMethodByObject('EMERGENCY') getMethodByObject('ALERT') getMethodByObject('CRITICAL') getMethodByObject('ERROR') getMethodByObject('WARNING') getMethodByObject('NOTICE') getMethodByObject('INFO') getMethodByObject('DEBUG') getMethodByObject('NOTICE') getMethodByObject('NOTICE') getMethodByObject('EMERGENCY') getMethodByObject('ALERT') getMethodByObject('CRITICAL') getMethodByObject('ERROR') getMethodByObject('WARNING') getMethodByObject('NOTICE') getMethodByObject('INFO') getMethodByObject('DEBUG') getMethodByObject('NOTICE') getMethodByObject('NOTICE') getMethodByObject('EMERGENCY') getMethodByObject('ALERT') getMethodByObject('CRITICAL') getMethodByObject('ERROR') getMethodByObject('WARNING') getMethodByObject('NOTICE') getMethodByObject('INFO') getMethodByObject('DEBUG') getMethodByObject('NOTICE') getMethodByObject('NOTICE') getMethodByObject('EMERGENCY') getMethodByObject('ALERT') getMethodByObject('CRITICAL') getMethodByObject('ERROR') getMethodByObject('WARNING') getMethodByObject('NOTICE') getMethodByObject('INFO') getMethodByObject('DEBUG') getMethodByObject('NOTICE') getMethodByObject('NOTICE') getMethodByObject('EMERGENCY') getMethodByObject('ALERT') getMethodByObject('CRITICAL') getMethodByObject('ERROR') getMethodByObject('WARNING') getMethodByObject('NOTICE') getMethodByObject('INFO') getMethodByObject('DEBUG') getMethodByObject('NOTICE') getMethodByObject('NOTICE') getMethodByObject('EMERGENCY') getMethodByObject('ALERT') getMethodByObject('CRITICAL') getMethodByObject('ERROR') getMethodByObject('WARNING') getMethodByObject('NOTICE') getMethodByObject('INFO') getMethodByObject('DEBUG') getMethodByObject('NOTICE') getMethodByObject('NOTICE') getMethodByObject('EMERGENCY') getMethodByObject('ALERT') getMethodByObject('CRITICAL') getMethodByObject('ERROR') getMethodByObject('WARNING') getMethodByObject('NOTICE') getMethodByObject('INFO') getMethodByObject('DEBUG') getMethodByObject('NOTICE') getMethodByObject('NOTICE') getMethodByObject('EMERGENCY') getMethodByObject('ALERT') getMethodByObject('CRITICAL') getMethodByObject('ERROR') getMethodByObject('WARNING') getMethodByObject('NOTICE') getMethodByObject('INFO') getMethodByObject('DEBUG') getMethodByObject('NOTICE') getMethodByObject('NOTICE') getMethodByObject('EMERGENCY') getMethodByObject('ALERT') getMethodByObject('CRITICAL') getMethodByObject('ERROR') getMethodByObject('WARNING') getMethodByObject('NOTICE') getMethodByObject('INFO') getMethodByObject('DEBUG') getMethodByObject('NOTICE') getMethodByObject('NOTICE') getMethodByObject('EMERGENCY') getMethodByObject('ALERT') getMethodByObject('CRITICAL') getMethodByObject('ERROR') getMethodByObject('WARNING') getMethodByObject('NOTICE') getMethodByObject('INFO') getMethodByObject('DEBUG') getMethodByObject('NOTICE')
Switch
function getMethodBySwitch(method) { switch (method) { case 'EMERGENCY': case 'ALERT': case 'CRITICAL': case 'ERROR': return 'error' case 'WARNING': return 'warn' case 'NOTICE': case 'INFO': return 'info' case 'DEBUG': return 'debug' default: return 'log' } } getMethodBySwitch('NOTICE') getMethodBySwitch('EMERGENCY') getMethodBySwitch('ALERT') getMethodBySwitch('CRITICAL') getMethodBySwitch('ERROR') getMethodBySwitch('WARNING') getMethodBySwitch('NOTICE') getMethodBySwitch('INFO') getMethodBySwitch('DEBUG') getMethodBySwitch('NOTICE') getMethodBySwitch('NOTICE') getMethodBySwitch('EMERGENCY') getMethodBySwitch('ALERT') getMethodBySwitch('CRITICAL') getMethodBySwitch('ERROR') getMethodBySwitch('WARNING') getMethodBySwitch('NOTICE') getMethodBySwitch('INFO') getMethodBySwitch('DEBUG') getMethodBySwitch('NOTICE') getMethodBySwitch('NOTICE') getMethodBySwitch('EMERGENCY') getMethodBySwitch('ALERT') getMethodBySwitch('CRITICAL') getMethodBySwitch('ERROR') getMethodBySwitch('WARNING') getMethodBySwitch('NOTICE') getMethodBySwitch('INFO') getMethodBySwitch('DEBUG') getMethodBySwitch('NOTICE') getMethodBySwitch('NOTICE') getMethodBySwitch('EMERGENCY') getMethodBySwitch('ALERT') getMethodBySwitch('CRITICAL') getMethodBySwitch('ERROR') getMethodBySwitch('WARNING') getMethodBySwitch('NOTICE') getMethodBySwitch('INFO') getMethodBySwitch('DEBUG') getMethodBySwitch('NOTICE') getMethodBySwitch('NOTICE') getMethodBySwitch('EMERGENCY') getMethodBySwitch('ALERT') getMethodBySwitch('CRITICAL') getMethodBySwitch('ERROR') getMethodBySwitch('WARNING') getMethodBySwitch('NOTICE') getMethodBySwitch('INFO') getMethodBySwitch('DEBUG') getMethodBySwitch('NOTICE') getMethodBySwitch('NOTICE') getMethodBySwitch('EMERGENCY') getMethodBySwitch('ALERT') getMethodBySwitch('CRITICAL') getMethodBySwitch('ERROR') getMethodBySwitch('WARNING') getMethodBySwitch('NOTICE') getMethodBySwitch('INFO') getMethodBySwitch('DEBUG') getMethodBySwitch('NOTICE') getMethodBySwitch('NOTICE') getMethodBySwitch('EMERGENCY') getMethodBySwitch('ALERT') getMethodBySwitch('CRITICAL') getMethodBySwitch('ERROR') getMethodBySwitch('WARNING') getMethodBySwitch('NOTICE') getMethodBySwitch('INFO') getMethodBySwitch('DEBUG') getMethodBySwitch('NOTICE') getMethodBySwitch('NOTICE') getMethodBySwitch('EMERGENCY') getMethodBySwitch('ALERT') getMethodBySwitch('CRITICAL') getMethodBySwitch('ERROR') getMethodBySwitch('WARNING') getMethodBySwitch('NOTICE') getMethodBySwitch('INFO') getMethodBySwitch('DEBUG') getMethodBySwitch('NOTICE') getMethodBySwitch('NOTICE') getMethodBySwitch('EMERGENCY') getMethodBySwitch('ALERT') getMethodBySwitch('CRITICAL') getMethodBySwitch('ERROR') getMethodBySwitch('WARNING') getMethodBySwitch('NOTICE') getMethodBySwitch('INFO') getMethodBySwitch('DEBUG') getMethodBySwitch('NOTICE') getMethodBySwitch('NOTICE') getMethodBySwitch('EMERGENCY') getMethodBySwitch('ALERT') getMethodBySwitch('CRITICAL') getMethodBySwitch('ERROR') getMethodBySwitch('WARNING') getMethodBySwitch('NOTICE') getMethodBySwitch('INFO') getMethodBySwitch('DEBUG') getMethodBySwitch('NOTICE')
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Object
Switch
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Autogenerated LLM Summary
(model
llama3.2:3b
, generated one year ago):
I'll do my best to provide an answer without referencing the full text of the benchmark results. It appears that the `getMethodBySwitch` function is being tested with various switch names, including `DEBUG`, `NOTICE`, `EMERGENCY`, `ALERT`, `CRITICAL`, and `ERROR`. The function seems to be returning a value in response to each switch name. Can you please provide more context or information about what the `getMethodBySwitch` function is supposed to do? Is it meant to return a specific value, an error message, or something else? Additionally, are there any specific details from the benchmark results that you would like me to focus on or ignore?
Related benchmarks:
Data Properties vs. Accessor Properties vs. Getter / Setter Methods 1
Data Properties vs. Accessor Properties vs. Getter / Setter Methods 2
Object.keys/Object.values/Object.entries
Data Properties vs. Accessor Properties vs. Getter / Setter Methods vs Proxy
Data Properties vs. Accessor Properties vs. Getter / Setter Methods v3
Comments
Confirm delete:
Do you really want to delete benchmark?