Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
test123kjfhneurkgewrxfiewhlrugxerg123
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
Browser:
Chrome 124
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
1
7255506.5 Ops/sec
2
3090829.8 Ops/sec
Script Preparation code:
var getLabel = (key) => { switch (key) { case 'a': return 'a'; case 'b': return 'b'; default: return 'c'; } } var dictionary = { a: 'a', b: 'b', c: 'c', }
Tests:
1
const obj = {}; for (const key of Object.values(dictionary)) { obj[key] = { value: key, label: getLabel(key), } }
2
const obj = Object.fromEntries(Object.values(dictionary).map((item) => ([item.value, item])));