Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
Chrome 120
Windows
Desktop
2 years ago
Benchmark.js
destructuring dynamic key
5.9M/s
destructuring with defaults, find item
5.1M/s
lodash dynamic key using manually cached array
4.0M/s
destructuring with defaults, empty input
3.9M/s
lodash dynamic key using array
3.9M/s
lodash get, find item
2.8M/s
lodash dynamic key
2.0M/s
lodash get, empty input
1.4M/s
View exact numbers
Test name Executions per second
destructuring dynamic key 5,914,286 Ops/sec
destructuring with defaults, find item 5,074,855 Ops/sec
lodash dynamic key using manually cached array 3,950,542 Ops/sec
destructuring with defaults, empty input 3,933,060 Ops/sec
lodash dynamic key using array 3,860,482 Ops/sec
lodash get, find item 2,836,176 Ops/sec
lodash dynamic key 2,019,990 Ops/sec
lodash get, empty input 1,430,602 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests: