Author: Olaf Jenkner
Date: 16:30:13 03/15/01
Go up one level in this thread
>>A look at the generated code shows some horrible things: >> >>Example: if(a[i]=x)or(a[i]=y)or(a[i]=z)then ... >> Delphi does not know that it can load the value >> of a[i] in a register only on once. >> >>I think many things could be done better without a great optimization. > >Or change the code to > >tmp:=a[i]; >if (tmp=x) or (tmp=y) or (tmp=z) then ... > >BTW the behavour of the array a[] is different depending if it's a global,local >or dynamic array. So is its speed. Global dynamic is fastest if the size of the >elements is a multiple of 32 bit. > >That's what I mean with you have to know the compiler. > >cheers, >Tony > >> >>OJe Why do I have to program around compiler weaknesses? Perhaps the variable tmp is not hold in a register. What I mean: In simple cases, as shown above, I wish a better behaviour of compilers. I know that there are compilers which are extremely optimizing to minimize RAM accesses or to shrink the code or to minimize the number of clock ticks. All of them I can't see when I look at the generated code of Delphi. It's a pity because I don't know much about C++ and have no experience in it. Thanks fro your posting OJe
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.