[Haskell-cafe] poor performance when generating random text

Dmitry Vyal akamaus at gmail.com
Wed Oct 17 21:10:24 CEST 2012


On 10/17/2012 12:45 PM, Alfredo Di Napoli wrote:
> What about this? I've tested on my pc and seems pretty fast. The trick 
> is to generate the gen only once. Not sure if the inlines helps, though:
>

 > What about this? I've tested on my pc and seems pretty fast. The 
trick is to generate the gen only once. Not sure if the inlines helps, 
though
...

Wow, haskell-cafe is a wonderful place! In just a two hours program run 
time automagically improved 20x ;) Thanks Alfredo, code works wonderful. 
Compared to mine implementation it's 2.5 sec vs 50 sec on my laptop. 
Interesting, how it compares to C now.

Inlining makes about 50x difference when code compiled without 
optimization. A nice example.

Best wishes,
Dmitry




More information about the Haskell-Cafe mailing list