[Haskell-cafe] Substring replacements

Branimir Maksimovic bmaxa at hotmail.com
Wed Dec 14 19:22:07 EST 2005




>From: Daniel Fischer <daniel.is.fischer at web.de>
>To: "Branimir Maksimovic" <bmaxa at hotmail.com>
>CC: Haskell-Cafe at haskell.org
>Subject: Re: [Haskell-cafe] Substring replacements
>Date: Wed, 14 Dec 2005 17:10:20 +0100
>

>
> > I think that's because on your machine Bulat's version have better
> > perfromance
> > with CPU cache.
> > I don;t know but now your version is 25% faster with my test on P4
> > hyperthreaded.
>
>Errrr, what's 'hyperthreaded' ? Unfortunately, I'm completely useless with
>computers.

I think that i've figure it now.
Hyperthreading is hardware CPU feature that single CPU core
can speed up execution of two running threads.
For example if one thread uses integer unit and other FP unit
CPU executes that in parallel. But that's not important
or significant. What is interestenting is memory latency.
If one thread peeks and pokes around memory for , say 1
unit of time, with usual CPU two thread will execute
2 units of time. Hyperthreaded (I'm talking about intel implementation)
CPU will execute that in 1.4 points of time giving 60% boost
in terms of speed. I've tested some assembler and C program
that launches two threads each roaming over memory
to anulate impact of cache.
What is noticable is that two threads have 60% less memory
latency constantly then single thread. That means if
single thread for each out of cache memory access waits
300-400 CPU cycles, two threads wait 60% less.
Now what has that to do with our programs as they are single
threaded? I think it's garbage collection.
Our programs run with garbage collector in background and
you feel that burden by 20% as your program probably pushes
garbage collector to work more than Bulat's version.
On hyperthreaded CPU impact of garbage collection is reduced
by a factor of 30-60 % resulting in your program being 30% faster
on my machine.

Greetings, Bane.

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/



More information about the Haskell-Cafe mailing list