Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0
Chrome 124
Mac OS X 10.15.7
Desktop
2 years ago
Length 10 destructuring swap
3.1M/s
Length 10 temp swap
3.1M/s
Length 100 destructuring swap
2.9M/s
Length 100 temp swap
2.9M/s
Length 1000 destructuring swap
1.5M/s
Length 1000 temp swap
1.5M/s
View exact numbers
Test name Executions per second
Length 10 destructuring swap 3,147,098 Ops/sec
Length 10 temp swap 3,093,050 Ops/sec
Length 100 destructuring swap 2,921,315 Ops/sec
Length 100 temp swap 2,866,433 Ops/sec
Length 1000 destructuring swap 1,531,247 Ops/sec
Length 1000 temp swap 1,519,770 Ops/sec
Script Preparation code:
Tests: