Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36
Chrome 129
Windows
Desktop
one year ago
Benchmark.js
destructuring with defaults, empty input
8.7M/s
destructuring dynamic key
5.2M/s
destructuring with defaults, find item
5.0M/s
lodash dynamic key using array
2.8M/s
lodash get, empty input
2.7M/s
lodash dynamic key using manually cached array
2.6M/s
lodash get, find item
2.1M/s
lodash dynamic key
1.5M/s
View exact numbers
Test name Executions per second
destructuring with defaults, empty input 8,724,300 Ops/sec
destructuring dynamic key 5,215,727 Ops/sec
destructuring with defaults, find item 4,966,254 Ops/sec
lodash dynamic key using array 2,761,547 Ops/sec
lodash get, empty input 2,679,860 Ops/sec
lodash dynamic key using manually cached array 2,635,061 Ops/sec
lodash get, find item 2,098,990 Ops/sec
lodash dynamic key 1,515,510 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests: