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
2 months ago
Test name Executions per second
Length 10 temp swap 8906382.0 Ops/sec
Length 10 destructuring swap 11441229.0 Ops/sec
Length 100 temp swap 4437890.5 Ops/sec
Length 100 destructuring swap 4656239.5 Ops/sec
Length 1000 temp swap 754892.2 Ops/sec
Length 1000 destructuring swap 761471.8 Ops/sec
Length 10 xor swap 10858186.0 Ops/sec
Length 100 xor swap 3713985.8 Ops/sec
Length 1000 xor swap 699407.6 Ops/sec
Script Preparation code:
Tests:
  • Length 10 temp swap

  • Length 10 destructuring swap

  • Length 100 temp swap

  • Length 100 destructuring swap

  • Length 1000 temp swap

  • Length 1000 destructuring swap

  • Length 10 xor swap

  • Length 100 xor swap

  • Length 1000 xor swap