From: Daniel Fischer <[EMAIL PROTECTED]>
To: "Branimir Maksimovic" <[EMAIL PROTECTED]>
CC: [email protected]
Subject: Re: Differences in optimisiation with interactive and compiled mo
Date: Sat, 10 Dec 2005 15:11:31 +0100

Am Donnerstag, 8. Dezember 2005 19:17 schrieb Branimir Maksimovic:
> From: Henning Thielemann <[EMAIL PROTECTED]>
>
> >To: Branimir Maksimovic <[EMAIL PROTECTED]>
> >CC: [email protected]
> >Subject: Re: [Haskell-cafe] Differences in optimisiation with interactive
> >and compiled mode
> >Date: Thu, 8 Dec 2005 18:38:45 +0100 (MET)
> >
> >On Thu, 8 Dec 2005, Branimir Maksimovic wrote:
> > > program performs search replace on a String
> >
> >http://www.haskell.org/pipermail/haskell-cafe/2005-April/009692.html
>
> This is nice and ellegant but example search replace program runs more
> then 50% faster with my implementation.
>
> Greetings, Bane.
>
That's probably because Lemmih's is polymorphic.
Yesterday evening, I cooked up my own version

Then Lemmih's is a bit faster than mine (a bit slower, if compiled for
profiling) which is still a bit faster than yours (and, profiling, yours is
significantly slower than the others.

I've fixed function signatures for strings only.
this is my test:
$ ghc -fglasgow-exts  -O2 srchrep.hs --make -o srchrep.exe
Chasing modules from: srchrep.hs
Compiling Main             ( srchrep.hs, srchrep.o )
Linking ...

[EMAIL PROTECTED] ~/tutorial
$ ghc -fglasgow-exts  -O2 replace.hs --make -o replace.exe
Chasing modules from: replace.hs
Compiling Main             ( replace.hs, replace.o )
Linking ...

[EMAIL PROTECTED] ~/tutorial
$ ghc -fglasgow-exts  -O2 searchr.hs --make -o searchr.exe
Chasing modules from: searchr.hs
Compiling Main             ( searchr.hs, searchr.o )
Linking ...

[EMAIL PROTECTED] ~/tutorial
$ time ./searchr.
searchr.exe  searchr.hi   searchr.hs   searchr.o

[EMAIL PROTECTED] ~/tutorial
$ time ./searchr.exe
Working:seaseasearch replace able seaseaseasearch baker seaseasearch charlie
True
Done


real    0m12.547s
user    0m0.015s
sys     0m0.000s

[EMAIL PROTECTED] ~/tutorial
$ time ./replace.exe
Working:seaseasearch replace able seaseaseasearch baker seaseasearch charlie
True
Done


real    0m21.078s
user    0m0.015s
sys     0m0.015s

[EMAIL PROTECTED] ~/tutorial
$ time ./srchrep.exe
Working:seaseasearch replace able seaseaseasearch baker seaseasearch charlie
True
Done


real    0m12.188s
user    0m0.015s
sys     0m0.000s


Your version seems fastest.

Greetings, Bane.

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

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to