Run details:
Mozilla/5.0 (iPhone; CPU iPhone OS 17_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/121.0.6167.138 Mobile/15E148 Safari/604.1
Chrome Mobile iOS 121
iOS 17.2
Mobile
2 years ago
Benchmark.js
destructuring with defaults, empty input
5.7M/s
destructuring dynamic key
4.7M/s
lodash dynamic key using manually cached array
2.1M/s
destructuring with defaults, find item
1.6M/s
lodash dynamic key using array
1.6M/s
lodash get, find item
1.1M/s
lodash get, empty input
976K/s
lodash dynamic key
510K/s
View exact numbers
Test name Executions per second
destructuring with defaults, empty input 5,656,244 Ops/sec
destructuring dynamic key 4,716,849 Ops/sec
lodash dynamic key using manually cached array 2,066,528 Ops/sec
destructuring with defaults, find item 1,610,104 Ops/sec
lodash dynamic key using array 1,569,946 Ops/sec
lodash get, find item 1,117,374 Ops/sec
lodash get, empty input 975,671 Ops/sec
lodash dynamic key 510,264 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests: