On Sat, Sep 25, 2010 at 7:02 PM, Btsai <[email protected]> wrote: > I went through the rest of my Project Euler code. In addition to > even?, there are some functions in clojure.contrib that are also much > slower in 1.3 Alpha 1. > > clojure.contrib.math -> expt > > (Clojure 1.2) > user=> (time (doseq [x (range 100000)] (expt x 2))) > "Elapsed time: 119.417971 msecs" > > (Clojure 1.3) > user=> (time (doseq [x (range 100000)] (expt x 2))) > "Elapsed time: 10314.24357 msecs"
Actually, I'd expect that expt would no longer be guaranteed to produce the right results for large integers in 1.3. The whole point of clojure.contrib.math is to extend math operations to the full numeric tower supported by Clojure and 1.3 breaks that. I haven't tried 1.3 yet, but I'd recommend downloading a copy of clojure.contrib.math locally and replace any instances of +, -, *, inc, dec with +', -', *', inc', dec'. This should at least make the functions produce the correct results. I'd be curious to know whether performance continues to be bad after making those changes, so if you do this experiment, please report your results. --Mark -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en
