On Wed, Dec 29, 2010 at 12:27 AM, Mark Engelberg
<[email protected]>wrote:

> Clearly, I couldn't really answer that question without doing some
> investigating to see what the speed difference is like.  I was even
> hoping that if the speed difference were small enough, I could bundle
> up a little library that implements HashMap as a Clojure hash map in
> an atom, so that my Java pals could start using Clojure's hash maps as
> a drop-in replacement for Java's (that's where the gen-class piece of
> the experiment comes in).  But with a 10x speed difference and so much
> more memory churn, I think that's going to be a tough sell.  It's
> possible that Clojure becomes more competitive with Java under a lot
> of contention for access from different threads, but I haven't tested
> that out yet.
>
> Anyway, thanks for confirming that the ratio of speeds on your machine
> are similar to mine.


Even in in a single threaded context raw insert performance isn't the final
word. What if you want to be able to deliver a snapshot for reporting? In
Clojure that's free. In Java that's a blocking copy of a HashMap with 1e5
keys. Ick.

That's the problem with naive benchmarks. They only sound good until you
have to write real programs that do real work.

David

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

Reply via email to