On Sunday, February 3, 2013 9:56:49 PM UTC-5, puzzler wrote: > > In these examples, the map/record is freshly created each time through the > loop, so caching should not be a factor. >
Good point. So maybe it's not the caching :). Another factor is that literal hashmaps are actually PersistentArrayMaps. If you use PersistentHashMaps instead of PersistentArrayMaps you get similar performance: Clojure 1.5.0-RC4 user=> (class {:x "a" :y 3}) clojure.lang.PersistentArrayMap user=> (time (dotimes [n 10000000] (hash (hash-map :x "a" :y 3)))) "Elapsed time: 3315.031872 msecs" nil Paul -- -- 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.