Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36 Edg/142.0.0.0
Chrome 142
Windows
Desktop
6 months ago
Test name Executions per second
Length 10 temp swap 40125360.0 Ops/sec
Length 10 destructuring swap 52704984.0 Ops/sec
Length 100 temp swap 21458682.0 Ops/sec
Length 100 destructuring swap 22354640.0 Ops/sec
Length 1000 temp swap 3367782.0 Ops/sec
Length 1000 destructuring swap 3454685.0 Ops/sec
Length 10 xor swap 41836324.0 Ops/sec
Length 100 xor swap 20714988.0 Ops/sec
Length 1000 xor swap 2993624.5 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