Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
Chrome 121
Windows
Desktop
2 years ago
Benchmark.js
destructuring with defaults, empty input
8.3M/s
destructuring dynamic key
3.2M/s
destructuring with defaults, find item
3.0M/s
lodash get, empty input
2.4M/s
lodash dynamic key using array
1.9M/s
lodash dynamic key using manually cached array
1.9M/s
lodash get, find item
1.5M/s
lodash dynamic key
1.2M/s
View exact numbers
Test name Executions per second
destructuring with defaults, empty input 8,307,850 Ops/sec
destructuring dynamic key 3,159,076 Ops/sec
destructuring with defaults, find item 2,989,842 Ops/sec
lodash get, empty input 2,437,949 Ops/sec
lodash dynamic key using array 1,939,544 Ops/sec
lodash dynamic key using manually cached array 1,925,552 Ops/sec
lodash get, find item 1,544,972 Ops/sec
lodash dynamic key 1,151,073 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests: