Run details:
Mozilla/5.0 (iPhone; CPU iPhone OS 17_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Mobile/15E148 Safari/604.1
Mobile Safari 17
iOS 17.5.1
Mobile
2 years ago
Benchmark.js
destructuring with defaults, empty input
9.3M/s
destructuring with defaults, find item
8.1M/s
destructuring dynamic key
6.6M/s
lodash dynamic key using array
2.5M/s
lodash dynamic key using manually cached array
2.4M/s
lodash get, empty input
2.0M/s
lodash get, find item
1.6M/s
lodash dynamic key
1.5M/s
View exact numbers
Test name Executions per second
destructuring with defaults, empty input 9,291,798 Ops/sec
destructuring with defaults, find item 8,083,448 Ops/sec
destructuring dynamic key 6,597,049 Ops/sec
lodash dynamic key using array 2,454,521 Ops/sec
lodash dynamic key using manually cached array 2,441,865 Ops/sec
lodash get, empty input 1,962,438 Ops/sec
lodash get, find item 1,616,291 Ops/sec
lodash dynamic key 1,456,100 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests: