Integer/long swaps: shaving off a few cycles

Share your advanced PureBasic knowledge/code with the community.
dell_jockey
Enthusiast
Enthusiast
Posts: 767
Joined: Sat Jan 24, 2004 6:56 pm

Integer/long swaps: shaving off a few cycles

Post by dell_jockey »

Deleted, see posts below....
Last edited by dell_jockey on Mon Jan 28, 2008 2:15 pm, edited 1 time in total.
cheers,
dell_jockey
________
http://blog.forex-trading-ideas.com
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

1. Don't do speed testing with the debugger on.
2. A normal "Swap a, b" is twice as fast as your XOR swap.
dell_jockey
Enthusiast
Enthusiast
Posts: 767
Joined: Sat Jan 24, 2004 6:56 pm

Post by dell_jockey »

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.
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?

2: I stand corrected here, I didn't even know PB had a swap built-in :oops: Thanks for pointing this out! I had downloaded a bit of code that had a swap macro included and assumed that PB doesn't have one. This set off my thought train. Should have checked the manual first.... So, without much ado, I deleted the post above....
cheers,
dell_jockey
________
http://blog.forex-trading-ideas.com
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

dell_jockey wrote:
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.
1: not even to compare the relative merit of two methods?
No. Because native commands aren't slowed down by the same magnitude as your own with the debugger on.
Post Reply