[Haskell-cafe] How to benckmark a Word64 -> Bool?
alois.cochard at gmail.com
Wed Feb 19 18:17:49 UTC 2014
Criterion might give you more precise results :
On Feb 19, 2014 5:37 PM, "Charles-Pierre Astolfi" <cpa at crans.org> wrote:
> I have a Word64 -> Bool function called only012 that returns True iff the
> digits in base 10 are 0, 1 or 2.
> I wand to make sure that I'm competitive with C, so I wrote the following
> Haskell version:
> C version:
> $ ghc --make -O3 303only012.hs && time ./303only012 50000000 > /dev/null
> ./303only012 50000000 > /dev/null 21.44s user 0.41s system 91% cpu 23.754
> $ g++ -O3 303only012.cpp -o 303cpponly012 && time ./303cpponly012 50000000
> > /dev/null
> ./303cpponly012 50000000 > /dev/null 13.87s user 0.03s system 95% cpu
> 14.577 total
> So there's a difference, but I'm not sure if it's related to my algorithm
> or related to IO/RTS.
> The core output of only012 looks quite tight: http://lpaste.net/100130
> Am I doing the IO part right, that is fast IO that is not screwing my
> benckmark? I'm not so sure about that since I use a convoluted way to print
> the boolean result in Haskell.
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe