Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36
Chrome 128
Mac OS X 10.15.7
Desktop
2 years ago
Benchmark.js
destructuring with defaults, empty input
4.4M/s
destructuring dynamic key
3.1M/s
destructuring with defaults, find item
3.0M/s
lodash dynamic key using array
1.6M/s
lodash dynamic key using manually cached array
1.4M/s
lodash get, empty input
1.3M/s
lodash get, find item
1.2M/s
lodash dynamic key
813K/s
View exact numbers
Test name Executions per second
destructuring with defaults, empty input 4,397,571 Ops/sec
destructuring dynamic key 3,063,364 Ops/sec
destructuring with defaults, find item 2,980,443 Ops/sec
lodash dynamic key using array 1,562,853 Ops/sec
lodash dynamic key using manually cached array 1,410,442 Ops/sec
lodash get, empty input 1,329,777 Ops/sec
lodash get, find item 1,172,540 Ops/sec
lodash dynamic key 812,846 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests: