Can this loop be made faster ?

From: -\\\\o//-annabee (faq_at_.@.@szmyggenpv.com)
Date: 02/22/05


Date: Tue, 22 Feb 2005 03:38:14 +0100


[SizeOf_Particle 32]
[Particle.Position.X 0]
;eax points to first particle. ebx points to last

While eax < ebx
    inc D$eax ; + Particle.Position.X (saves a byte)
    add eax SizeOf_Particle
End_While ; (17 bytes)

I was wondering if someone could tell me if this loop can be made any
faster.
(I mean by thinking / doing it diffrently )

Also. Lets assume that eax points to memory allocated via Window
VirtualAlloc as a "continous" block of _virtual_ memory.

If the virtual memory are mapped to very diffrent areas of physical
memory. Will this at any point force the cache to flush ? Whats the worst
/ best case ?

-- 
http://TheWannabee.org


Relevant Pages