[Haskell-cafe] poor performance when generating random text
Alfredo Di Napoli
alfredo.dinapoli at gmail.com
Wed Oct 17 21:28:53 CEST 2012
Glad to have been helpful :)
Sent from my iPad
On 17/ott/2012, at 21:10, Dmitry Vyal <akamaus at gmail.com> wrote:
> 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,
More information about the Haskell-Cafe