I did some work to reduce consing and our generation of v1 (time-based) UUID's using clj-uuid are now about 40% faster than invoking the JVM's java.util.UUID/randomUUID static method:
user> (criterium.core/bench (uuid/v1)) Evaluation count : 51250020 in 60 samples of 854167 calls. Execution time mean : 1.130674 µs user> (criterium.core/bench (java.util.UUID/randomUUID)) Evaluation count : 31868100 in 60 samples of 531135 calls. Execution time mean : 1.920089 µs On Monday, February 16, 2015 at 8:25:17 PM UTC-5, danl...@gmail.com wrote: > > Hello Clojurians, > > I've just been polishing my modest library, clj-uuid < > http://danlentz.github.io/clj-uuid/> and would like to invite everyone to > have a look if such a thing might be of interest. > > What is it? > > clj-uuid is a Clojure library for generation and utilization of UUIDs > (Universally Unique Identifiers) as described by RFC-4122. This library > extends the standard Java UUID class to provide true v1 (time based) and > v3/v5 (namespace based) identifier generation. Additionally, a number of > useful supporting utilities are provided to support serialization and > manipulation of these UUIDs in a simple, efficient manner. > > Why is it useful? > > The JVM UUID class only provides a constructor for random (v4) and > (non-namespaced) pseudo-v3 UUID's. Where appropriate, this library does use > the internal JVM UUID implementation. The benefit with this library is that > clj-uuid provides an easy way to get v1 and true namespaced v3 and v5 > UUIDs. v1 UUIDs are really useful because they can be generated faster > than v4's as they don't need to call a cryptographic random number > generator. v5 UUID's are necessary because many of the interesting > things that you can do with UUID's require namespaced identifiers. > http://danlentz.github.io/clj-uuid/ > http://github.com/danlentz/clj-uuid/ > > > Best, > Dan Lentz > -- 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/d/optout.