Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.0.0
Chrome 127
Windows
Desktop
2 years ago
Benchmark.js
destructuring with defaults, empty input
5.9M/s
destructuring dynamic key
4.0M/s
destructuring with defaults, find item
4.0M/s
lodash dynamic key using array
2.1M/s
lodash dynamic key using manually cached array
2.1M/s
lodash get, empty input
1.9M/s
lodash get, find item
1.5M/s
lodash dynamic key
1.1M/s
View exact numbers
Test name Executions per second
destructuring with defaults, empty input 5,937,158 Ops/sec
destructuring dynamic key 4,021,010 Ops/sec
destructuring with defaults, find item 3,998,975 Ops/sec
lodash dynamic key using array 2,116,580 Ops/sec
lodash dynamic key using manually cached array 2,115,232 Ops/sec
lodash get, empty input 1,877,967 Ops/sec
lodash get, find item 1,548,949 Ops/sec
lodash dynamic key 1,144,189 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests: