Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36
Chrome 122
Linux
Desktop
2 years ago
Benchmark.js
destructuring with defaults, empty input
5.8M/s
destructuring dynamic key
2.7M/s
destructuring with defaults, find item
2.7M/s
lodash get, empty input
1.9M/s
lodash dynamic key using manually cached array
1.6M/s
lodash dynamic key using array
1.6M/s
lodash get, find item
1.4M/s
lodash dynamic key
1.0M/s
View exact numbers
Test name Executions per second
destructuring with defaults, empty input 5,752,630 Ops/sec
destructuring dynamic key 2,717,132 Ops/sec
destructuring with defaults, find item 2,693,368 Ops/sec
lodash get, empty input 1,918,552 Ops/sec
lodash dynamic key using manually cached array 1,641,699 Ops/sec
lodash dynamic key using array 1,567,968 Ops/sec
lodash get, find item 1,372,272 Ops/sec
lodash dynamic key 1,017,256 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests: