Integer/long swaps: shaving off a few cycles
Posted: Mon Jan 28, 2008 1:57 pm
Deleted, see posts below....
http://www.purebasic.com
https://www.purebasic.fr/english/
1: not even to compare the relative merit of two methods? I know the durations measured will not be correct by a large margin, but surely that will be true for both methods tested?Trond wrote:1. Don't do speed testing with the debugger on.
2. A normal "Swap a, b" is twice as fast as your XOR swap.
No. Because native commands aren't slowed down by the same magnitude as your own with the debugger on.dell_jockey wrote:1: not even to compare the relative merit of two methods?Trond wrote:1. Don't do speed testing with the debugger on.
2. A normal "Swap a, b" is twice as fast as your XOR swap.