From 38b7da32a1f6f70ce9efcca3bce8c7761088ada8 Mon Sep 17 00:00:00 2001 From: David Arthur Date: Tue, 30 Oct 2012 23:26:04 -0300 Subject: [PATCH] Add a comment about I/O performance in README.md --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a578ffb..54d8b11 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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