Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36
Chrome 123
Windows
Desktop
2 years ago
Benchmark.js
destructuring with defaults, empty input
8.3M/s
destructuring dynamic key
2.9M/s
lodash get, empty input
2.1M/s
destructuring with defaults, find item
2.0M/s
lodash dynamic key using manually cached array
1.5M/s
lodash dynamic key using array
1.5M/s
lodash get, find item
1.3M/s
lodash dynamic key
881K/s
View exact numbers
Test name Executions per second
destructuring with defaults, empty input 8,255,223 Ops/sec
destructuring dynamic key 2,874,242 Ops/sec
lodash get, empty input 2,076,487 Ops/sec
destructuring with defaults, find item 2,047,955 Ops/sec
lodash dynamic key using manually cached array 1,503,720 Ops/sec
lodash dynamic key using array 1,488,772 Ops/sec
lodash get, find item 1,333,998 Ops/sec
lodash dynamic key 880,787 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests: