Run details:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Mobile Safari/537.36
Chrome Mobile 131
Android
Mobile
one year ago
Length 10 destructuring swap
11.4M/s
Length 10 xor swap
10.9M/s
Length 10 temp swap
8.9M/s
Length 100 destructuring swap
4.7M/s
Length 100 temp swap
4.4M/s
Length 100 xor swap
3.7M/s
Length 1000 destructuring swap
761K/s
Length 1000 temp swap
755K/s
Length 1000 xor swap
699K/s
View exact numbers
Test name Executions per second
Length 10 destructuring swap 11,441,229 Ops/sec
Length 10 xor swap 10,858,186 Ops/sec
Length 10 temp swap 8,906,382 Ops/sec
Length 100 destructuring swap 4,656,240 Ops/sec
Length 100 temp swap 4,437,890 Ops/sec
Length 100 xor swap 3,713,986 Ops/sec
Length 1000 destructuring swap 761,472 Ops/sec
Length 1000 temp swap 754,892 Ops/sec
Length 1000 xor swap 699,408 Ops/sec
Script Preparation code:
Tests: