On Feb 3, 11:40 pm, Alexandros Bantis <amban...@gmail.com> wrote:
> yes, I believe I can just make a list of the greatest common factors and
> then multiply them out to get the number rather than iterating through 2
> through n. Still, I'm curious about the performance difference, since
> all three are running on the same JVM and ultimately are all compiled
> down to java byte code, you would expect that a similar algorithm would
> produce similar results across the three.

I ran both provided Java code and my Clojure code (defaulting to (int
n) just like the Java version) with JVM `-server` option and. It made
no difference to the Java version at 18s, but the Clojure version came
down to 22s. This is probably because JIT inlining is more effective
in the -server mode and Clojure's primitive support depends on
inlining for performance: http://clojure.org/news

Shantanu

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to