Chick Corea wrote:
> The corresponding Java code (w/ the hash-insert omitted in the clojure
> version)
> runs in 5.5sec and uses 290MB.
> 
> This code runs (which omits the hash-insert) runs in 17.8sec and uses
> 353MB.
> 
> I thought that I added all of the casts and "warn-on-reflections" that
> would help.
> Also, I thought using Java data structures directly would bypass some
> of Clojure's
> overhead.  What am I missing?

Not sure about the speed difference, but how are measuring memory usage? 
  Your memory figures might include a bunch of garbage that hasn't be 
GCed yetm, Clojure code tends to make lots more garbage than Java code 
due to the immutability.  You could try forcing a GC with (System/gc) 
and see if it changes your readings.  If it's generating exactly the 
same structure as the java code, Clojure should be using the same amount 
of memory (aside from the initial overhead).

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