My 2 cents,  I read about transients for the first time (why is the
page not linked from clojure.org?) and they seem very promising at a
first glance.

I'm not sure if I agree with Michael's idea of having the same
functions for transients and persistents both.  Functions should have
easy, reproducible semantics imo.  If I take a look at a function call
in isolation of its environment, I should be able to predict its
semantics exactly, not in 90% cases, but 100% (maybe ideal, given my
inexperience).

But I do agree with his concern about the multitude of functions for
persistents and very few for transients.  If I want my bottleneck
function to use transients, it should be straightforward.  Else most
of the energy would be spent to re write things like foo-in etc.  But
maybe that's a deliberate design decision take by Rich not to make
transients popular?

On the transients page Rich has given a very simple benchmark -

(time (def v (vrange 1000000)))
"Elapsed time: 297.444 msecs"

(time (def v2 (vrange2 1000000)))
"Elapsed time: 34.428 msecs"

But on my system I don't get a ~9x performance boost, it mostly get a
~3x performance boost (1.2).  Have there been some changes?  What do
other people get?

(time (def v (vrange 1000000)))
"Elapsed time: 261.82 msecs"

(time (def v2 (vrange2 1000000)))
"Elapsed time: 87.3 msecs"

Michael: "bash in place" means in-place memory writing, for example in
Java we have a Collections.sort(list) method which uses in-place merge
sort.  That method doesn't return a sorted list, it just changes the
original list in place (which is more memory efficient).  Hope I've
been successful in conveying to you.

- Thanks

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