Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:127.0) Gecko/20100101 Firefox/127.0
Firefox 127
Windows
Desktop
2 years ago
Benchmark.js
destructuring with defaults, empty input
77.1M/s
destructuring dynamic key
43.6M/s
destructuring with defaults, find item
42.4M/s
lodash dynamic key using array
12.6M/s
lodash dynamic key using manually cached array
10.8M/s
lodash get, empty input
4.9M/s
lodash get, find item
4.2M/s
lodash dynamic key
2.5M/s
View exact numbers
Test name Executions per second
destructuring with defaults, empty input 77,056,128 Ops/sec
destructuring dynamic key 43,610,452 Ops/sec
destructuring with defaults, find item 42,383,316 Ops/sec
lodash dynamic key using array 12,637,646 Ops/sec
lodash dynamic key using manually cached array 10,769,981 Ops/sec
lodash get, empty input 4,881,094 Ops/sec
lodash get, find item 4,222,496 Ops/sec
lodash dynamic key 2,472,558 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests: