
From: Daniel Fischer
To: "Branimir Maksimovic" CC: Haskell-Cafe@haskell.org 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
To: Branimir Maksimovic
CC: haskell-cafe@haskell.org 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 ... bmaxa@MAXA ~/tutorial $ ghc -fglasgow-exts -O2 replace.hs --make -o replace.exe Chasing modules from: replace.hs Compiling Main ( replace.hs, replace.o ) Linking ... bmaxa@MAXA ~/tutorial $ ghc -fglasgow-exts -O2 searchr.hs --make -o searchr.exe Chasing modules from: searchr.hs Compiling Main ( searchr.hs, searchr.o ) Linking ... bmaxa@MAXA ~/tutorial $ time ./searchr. searchr.exe searchr.hi searchr.hs searchr.o bmaxa@MAXA ~/tutorial $ time ./searchr.exe Working:seaseasearch replace able seaseaseasearch baker seaseasearch charlie True Done real 0m12.547s user 0m0.015s sys 0m0.000s bmaxa@MAXA ~/tutorial $ time ./replace.exe Working:seaseasearch replace able seaseaseasearch baker seaseasearch charlie True Done real 0m21.078s user 0m0.015s sys 0m0.015s bmaxa@MAXA ~/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/