DMD 1.034 and 2.018 releases
JAnderson
ask at me.com
Sat Aug 9 20:49:55 PDT 2008
Christopher Wright wrote:
> bearophile wrote:
>> Walter Bright:
>>> Can you make it faster?
>>
>> Lot of people today have 2 (or even 4 cores), the order of the
>> computation of those ops is arbitrary, so a major (nearly linear,
>> hopefully) speedup will probably come as soon all the cores are used.
>> This job splitting is probably an advantage even then the ops aren't
>> computed by asm code.
>
> The overhead of creating a new thread for this would be significant.
> You'd probably be better off using a regular loop for arrays that are
> not huge.
I agree. I think a lot of profiling would be in order to see when
certain things become an advantage to use. Then use a branch to jump to
the best algorithm for the particular case (platform + length of array).
Hopefully the compiler could inline the algorithm so that constant
sized arrays don't pay for the additional overhead.
There would be a small cost for the extra branch for small dynamic
arrays. Ideally one could argue that if this becomes a performance
bottleneck then the program is doing a lot of operations on lots of
small arrays. The user could change the design to group their small
arrays into a larger array to get the performance they desire.
-Joel
More information about the Digitalmars-d-announce
mailing list