Hi, On Wed, Jan 27, 2010 at 5:57 PM, Michał Marczyk <michal.marc...@gmail.com> wrote: > I've had a go at implementing an incremental SoE-like sieve in Clojure: > > http://gist.github.com/287986 > > It uses transients and appears to be quite a lot faster than the > clojure.contrib.lazy-seq/primes implementation, although regrettably > nowhere near as fast as the straightforward implementation of the same > thing in Python... :-( (See [2] for a super-optimised Python version.) > The version which is not using transients is slower, and to a really > spectacular degree at that -- I wonder if that's one case of a > programme spending more time in GC than on the actual computation at > hand.
See http://clj-me.cgrand.net/2009/07/30/everybody-loves-the-sieve-of-eratosthenes/ for other impls of the SoE -- there was no transients at the time but they are fast... and can be transientified. Christophe -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en