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 with defaults, empty input
6.2M/s
destructuring with defaults, find item
2.0M/s
destructuring dynamic key
1.9M/s
lodash get, empty input
1.5M/s
lodash dynamic key using array
1.2M/s
lodash dynamic key using manually cached array
1.2M/s
lodash get, find item
910K/s
lodash dynamic key
727K/s
View exact numbers
Test name Executions per second
destructuring with defaults, empty input 6,214,450 Ops/sec
destructuring with defaults, find item 1,989,021 Ops/sec
destructuring dynamic key 1,911,851 Ops/sec
lodash get, empty input 1,487,985 Ops/sec
lodash dynamic key using array 1,187,320 Ops/sec
lodash dynamic key using manually cached array 1,155,578 Ops/sec
lodash get, find item 909,884 Ops/sec
lodash dynamic key 727,016 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests: