Skip to content

Commit

Permalink
Add a comment about I/O performance in README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mumrah committed Oct 31, 2012
1 parent 6bfe4f2 commit 38b7da3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Unique Id generator

Based on http://blog.boundary.com/2012/01/12/Flake-A-decentralized-k-ordered-id-generation-service-in-Erlang.html
which is in turn based on Twitter''s Snowflake project: http://engineering.twitter.com/2010/06/announcing-snowflake.html
which is in turn based on Twitter's Snowflake project: http://engineering.twitter.com/2010/06/announcing-snowflake.html

Generates unique ids based on the current epoch time, current machine identity,
and a counter. The result are mostly ordered unique ids that require no
Expand All @@ -28,10 +28,12 @@ synchronization between machines.
$ ls -lh out
-rw-r--r-- 1 mumrah staff 153M May 22 10:52 out

System I/O peaked at 8-8.5MB/s

540 id/ms

Since each id is 128 bits, the I/O rate comes out to 8640000 bytes per second, or 8.24 MB/s.
Compare this to 66.59 MB/s which is the speed that the same system can "yes > omgyes". I guess that order of
magnitude difference is the price of safety/synchronization.

## Pipe to /dev/null

$ time java -cp .:./lib/uuid-3.2.1-SNAPSHOT.jar:./lib/commons-codec-1.6.jar:src uniq.UniqueId 10000000 > /dev/null
Expand Down

0 comments on commit 38b7da3

Please sign in to comment.