[Haskell-cafe] Re: Timing difference

Aai bradypus at xs4all.nl
Thu Dec 25 05:52:39 EST 2008

Compiled timing (point free version: doesn't matter though as mentioned
by Bulat):

..> ghc -O2 ./../Puzzels/Rosetta/probabilistic_choice.hs  -o proba
..> time ./proba

real    0m9.975s
user    0m9.765s
sys     0m0.212s

(12.26 secs, 2470869600 bytes)

So about 20 pct faster than interpreted point free: not world shaking.
May be there's a compile optimization that I'm not aware of.



Max Vasin schreef:
> Aai пишет:
>> Hi Bulat,
>> That I (can) understand, but of course the main question is: is point
>> free in (some/several/all) cases faster than the more readable lambda
>> construction? That's to say when executed in GHCi. I noticed this
>> behavior before (pity I haven't other examples at hand). In prog. lang.
>> J ( http://www.jsoftware.com/index.html ) I see the same behavior
>> difference with tacit (like point free) and explicit programming: tacit
>> being faster in several (not all) occasions.
> You should write cleanest code. Optimize only when absolutely necessary
> (and in this case you'll definetly will use a compiled version instead
> of interpreted).
> -- 
> WBR,
> Max Vasin.
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe

More information about the Haskell-Cafe mailing list