Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
Chrome 124
Windows
Desktop
2 years ago
Benchmark.js
destructuring with defaults, empty input
5.8M/s
destructuring with defaults, find item
3.1M/s
destructuring dynamic key
3.0M/s
lodash get, empty input
2.4M/s
lodash dynamic key using manually cached array
1.9M/s
lodash dynamic key using array
1.9M/s
lodash get, find item
1.6M/s
lodash dynamic key
1.2M/s
View exact numbers
Test name Executions per second
destructuring with defaults, empty input 5,789,094 Ops/sec
destructuring with defaults, find item 3,105,204 Ops/sec
destructuring dynamic key 2,999,127 Ops/sec
lodash get, empty input 2,406,269 Ops/sec
lodash dynamic key using manually cached array 1,921,952 Ops/sec
lodash dynamic key using array 1,917,818 Ops/sec
lodash get, find item 1,586,677 Ops/sec
lodash dynamic key 1,170,560 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests: