Hi again Mark, I set up some basic micro-benchmarks <https://github.com/maxcountryman/flake/blob/b5cddf0069ae7e0d2db2e13206929a6c6d08f0f1/test/flake/test_core.clj#L75-L85> out of curiosity. Full disclosure, I’m not entirely sure I’m using criterium correctly here, but the results on my machine seem to show comparable performance: Flake generation is slightly faster (by a few nanoseconds) and Flake comparison is slightly slower (also by a few nanoseconds) as compared to Java’s random UUID.
Just to reiterate what I said before, while it’s encouraging to see the performance is perhaps at least comparable to at least one implementation of a UUID, that really isn’t the reason to use Flakes in the first place. Also if my tests aren’t set up correctly, I’d certainly appreciate any help correcting them! Max > On Jun 3, 2016, at 08:40, Max Countryman <m...@me.com> wrote: > > Hi Mark, > > I haven’t done any benchmarking comparing Flakes to UUIDs. However the > primary benefit of flake IDs, over a traditional UUID, e.g. UUID-1, is flakes > do not require coordination (i.e. to avoid clock-skew and duplicate IDs), > provide k-ordering (UUID-1’s bit ordering breaks this), and use the standard > Unix epoch. It would be interesting to compare performance, but the features > of flakes are certainly their primary selling points. > > > Max > >> On Jun 2, 2016, at 20:38, Mark Engelberg <mark.engelb...@gmail.com >> <mailto:mark.engelb...@gmail.com>> wrote: >> >> This is interesting. Is it faster than uuid for generation and/or comparing >> for equality? >> >> On Thu, Jun 2, 2016 at 6:03 PM, Max Countryman <m...@me.com >> <mailto:m...@me.com>> wrote: >> Hi, >> >> I’m happy to announce a new release of Flake, the decentralized, k-ordered >> unique ID generator. >> >> Flake 0.4.0 includes a number of important breaking changes, but by far the >> most important is dropping `generate` in favor of `generate!` which now >> returns a ByteBuffer. Previously `generate` returned a BigInteger, however >> this arbitrarily limits how an application can handle IDs and goes against >> the spirit of the Erlang implementation. In order to maintain backwards >> compatibility, a helper `flake->bigint` was added to the core namespace. >> Applications which already consume flakes should update their calls to >> `generate` so they are `generate!` and wrap them with `flake->bigint` if >> BigIntegers are desirable or already used. >> >> Github: https://github.com/maxcountryman/flake >> <https://github.com/maxcountryman/flake> >> Changes: https://github.com/maxcountryman/flake/blob/master/CHANGELOG.md >> <https://github.com/maxcountryman/flake/blob/master/CHANGELOG.md> >> >> Thanks! >> >> >> Max >> >> -- >> 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 >> <mailto: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 >> <mailto:clojure%2bunsubscr...@googlegroups.com> >> For more options, visit this group at >> http://groups.google.com/group/clojure?hl=en >> <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 >> <mailto:clojure%2bunsubscr...@googlegroups.com>. >> For more options, visit https://groups.google.com/d/optout >> <https://groups.google.com/d/optout>. >> >> >> -- >> 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 >> <mailto: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 >> <mailto:clojure+unsubscr...@googlegroups.com> >> For more options, visit this group at >> http://groups.google.com/group/clojure?hl=en >> <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 >> <mailto:clojure+unsubscr...@googlegroups.com>. >> For more options, visit https://groups.google.com/d/optout >> <https://groups.google.com/d/optout>. > > > -- > 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 > <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 > <mailto:clojure+unsubscr...@googlegroups.com>. > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>. -- 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.