Re: I need the fastest routine




"W. van Wezel" <huis@xxxxxxxxxxxxxx> wrote in message
news:48728a15$1@xxxxxxxxxxxxxxxxxxxxxxxxx
Oeps,

You're right. Also:
for I:=1 to numThreads-1 do if msgs[I].tMax<iMax then iMax:=msgs[I].tMax;
should be
for I:=1 to numThreads-1 do if msgs[I].tMax>iMax then iMax:=msgs[I].tMax;


ah yeah, spotted that one too, but forgot about it :P

although a simpler function for finding min & max works better on my PC
(single core):

Yes, because you can't compensate for the overhead of threading. What
happens if you set numThreads to 1?

Wout


I had to test them outside IDE, because it was having a large effect on the
result when a lot of threads were being used.

Original code: 0.774 seconds
Simple method: 0.372 seconds

1 Threads - 0.381 (0.390 inside IDE)
2 Threads - 0.382 (0.417 inside IDE)
3 Threads - 0.383
4 Threads - 0.385 (0.438 inside IDE)
8 threads - 0.385
16 threads - 0.387
128 threads - 0.44 (2.828 inside IDE)
256 threads - 0.503
1024 thread - 0.850

Dan.


.



Relevant Pages

  • Re: IPv6 module of Kernel 2.4.x & Kernel 2.6.x
    ... Is there much overhead in a module then? ... If the kernel has been built with a module loader (ie it is not ... Scalable - same core on embedded systems, ... Alternatives - Alternative module versions can be used ...
    (comp.os.linux.networking)
  • Re: IPv6 module of Kernel 2.4.x & Kernel 2.6.x
    ... Is there much overhead in a module then? ... If the kernel has been built with a module loader, ... Scalable - same core on embedded systems, ... Alternatives - Alternative module versions can be used ...
    (comp.os.linux.networking)
  • Re: Fast Line Count
    ... QueryPerformanceCounter usually gives the best resolution. ... empty loops and call overhead) and average across several runs. ... timeBeginPeriod. ... Yeah, I set the period to minimum, then wait the next tick. ...
    (microsoft.public.vb.general.discussion)
  • Re: Iterate before loop end
    ... >> I did consider GoTo, just for a moment, but you know what that leads ... >Yeah, in this instance, an optimal solution...no overhead of extra ...
    (microsoft.public.vb.general.discussion)
  • Re: (OT) For your fapping pleasure . . .
    ... And, uh, yeah, I kind of dig the SONGS. ... I thought the women were there to compensate for how week the music is, ...
    (rec.sport.pro-wrestling)