On Aug 6, 4:53 am, Rich Hickey <richhic...@gmail.com> wrote:
> On Aug 5, 10:10 pm, Luc Prefontaine <lprefonta...@softaddicts.ca>
> wrote:
>
> > I like this very much... that's the kind of clever optimizations that
> > preserves Clojure principles and
> > can yield significant performance increases. This could also help
> > dealing with performance critics
> > in these small mutable languages "benchmarks" that newbies attempt to
> > clone in Clojure.
>
> > Thank's Rich !
>
> You're welcome!
>
> And special thanks to Christophe Grand, who (quickly!) applied the
> same technique to the hash maps and contributed that yesterday. So
> now, in the master branch, vectors and hash maps support transients.
> Everyone please try them out (where appropriate :).
>
> Rich
Thank you, Christophe! I've been wanting to try those out.
I made changes to 3 lines of my Clojure program for the k-nucleotide
benchmark, which spends most of its time in a function tally-dna-subs-
with-len that creates a hash map counting the number of times that
each of a bunch of length k strings occurs in a long string. Source
here, if you're curious:
http://github.com/jafingerhut/clojure-benchmarks/blob/38e1f592ca3befe94a0674a5f5a43d952cd369b3/knuc/knucleotide.clj-7.clj
It went from about 19 minutes down to about 12 minutes. Excellent
improvement for a small change to the code. That brings it down to
about 7.7 times the run time of the Java version from the language
shootout web site.
Andy
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---