[email protected]
[Top] [All Lists]

[Haskell-cafe] Re: FASTER primes

Subject: [Haskell-cafe] Re: FASTER primes
From: Will Ness
Date: Tue, 5 Jan 2010 23:09:07 +0000 UTC
Daniel Fischer <daniel.is.fischer <at> web.de> writes:

> 
> 
> Am Montag 04 Januar 2010 22:25:28 schrieb Daniel Fischer:

> > memory still grows, but much slower, in my tests, due to the much smaller
> > GC time, it's a bit faster than the version with the original tfold.
> 
> Not for larger inputs (but not so large that the tree-fold dies OOM).
> Fix rfold:
> 
> rfold f [x] = x
> rfold f xs = rfold f (pairwise f xs)
> 
> and it's faster also for those.


Niiice!!!! This is just great!  :)

I tried a two-step feed BTW (that's three separate sets of lists) , with the
original structure. It ran with same speed as your new version (10..20% faster)
but with the memory of the previous one :) (80M for 8 mil primes vs the new
one's 10M). But your new structure is just great! I hoped there is something
better, that's why I posted it here in the first place. 

'pairwise' puts odd leafs higher on the right. It might be better if it was so
on the left, for the frequency of production is higher. 


Thanks a lot for your comments!


> 
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe <at> haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
> 




_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

<Prev in Thread] Current Thread [Next in Thread>