Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0
Chrome 126
Windows
Desktop
2 years ago
Benchmark.js
destructuring with defaults, empty input
6.8M/s
destructuring with defaults, find item
4.7M/s
destructuring dynamic key
4.7M/s
lodash dynamic key using array
2.5M/s
lodash dynamic key using manually cached array
2.4M/s
lodash get, empty input
2.3M/s
lodash get, find item
1.9M/s
lodash dynamic key
1.4M/s
View exact numbers
Test name Executions per second
destructuring with defaults, empty input 6,845,959 Ops/sec
destructuring with defaults, find item 4,686,338 Ops/sec
destructuring dynamic key 4,658,802 Ops/sec
lodash dynamic key using array 2,486,978 Ops/sec
lodash dynamic key using manually cached array 2,449,295 Ops/sec
lodash get, empty input 2,338,161 Ops/sec
lodash get, find item 1,919,433 Ops/sec
lodash dynamic key 1,417,745 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests: