
From: Daniel Fischer
To: sylvan@student.chalmers.se CC: Haskell-Cafe@haskell.org Subject: Re: [Haskell-cafe] Substring replacements Date: Mon, 12 Dec 2005 10:31:49 +0100 Am Montag, 12. Dezember 2005 01:34 schrieben Sie:
On 12/12/05, Daniel Fischer
wrote: Okay, I have looked up KMP and implemented it. Seems to work -- my first use of QuickCheck, too. It's slower than Bulat's and Tomasz' for Branimir's test :-(, but really fast for my test. Undoubtedly, one can still tune it.
Perhaps by using unboxed arrays...
/S
-- Sebastian Sylvan +46(0)736-818655 UIN: 44640862
I'm afraid, unboxed arrays are out of the question, because bord is incrementally produced :-(
Working very long test2: <<loop>>
No worrie your test is now fastest with both your and mine test. I;ve forgot to change working function in your test:0) mine test: your program is is srchrep.exe bmaxa@MAXA ~/tutorial $ time searchr.exe Working:seasearch replace able seaseasearch baker seasearch charlie True Done real 0m14.344s user 0m0.015s sys 0m0.015s bmaxa@MAXA ~/tutorial $ time srchrep.exe Working:seasearch replace able seaseasearch baker seasearch charlie True Done real 0m10.672s > your program is almost 1.5 secs faster then Bulat's user 0m0.015s sys 0m0.000s bmaxa@MAXA ~/tutorial $ time replace1.exe Working:seasearch replace able seaseasearch baker seasearch charlie True Done real 0m12.016s user 0m0.015s sys 0m0.015s now your test: bmaxa@MAXA ~/tutorial $ time searchr.exe Working very long True Done real 0m0.312s user 0m0.015s sys 0m0.015s bmaxa@MAXA ~/tutorial $ time replace1.exe Working very long False Done real 0m12.516s user 0m0.015s sys 0m0.015s bmaxa@MAXA ~/tutorial $ time srchrep.exe Working very long True Done real 0m0.375s > yours is less then second as mine but is fastest in both tests user 0m0.015s sys 0m0.015s I don;t know how you get lesser numbers with mine test, but on this machine your KMP algorithm performs best. Greetings ,Bane. _________________________________________________________________ Don't just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/