On Thu, Mar 10, 2011 at 10:39 PM, Jarl Haggerty <jarlhagge...@gmail.com>wrote:

> I've been benchmarking java and clojure programs and wanted to make
> sure I was doing this right.  I made two fairly similar programs that
> manipulated Vec2 objects from the JBox2D library.  At first clojure
> was performing pretty poorly, then I tried compiling my clojure
> script, and then replacing the inner doseq with a loop.  But java is
> still 5x faster and I hear that clojure should be able to run as fast
> as java and I wondered if there's any options in clojure I'm not using
>

Try replacing doseq w/ dotimes. You need to cast 1e9 to int, just like you
do w/ 0 if you're using Clojure <= 1.2.0. How long is it taking for you in
Clojure and Java?

David

-- 
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

Reply via email to