diff options
author | Francesco Mazzoli <francesco@rabbitmq.com> | 2012-01-17 12:19:31 +0000 |
---|---|---|
committer | Francesco Mazzoli <francesco@rabbitmq.com> | 2012-01-17 12:19:31 +0000 |
commit | 065f57944a56b7d8183dfa04761247b5b760fdef (patch) | |
tree | e02ac8b53fe9b947306053118e56b148ff4f2a69 /src/rabbit_basic.erl | |
parent | aea58d91b22163ee8cee76ce8d4b62224ebfa0e7 (diff) | |
download | rabbitmq-server-065f57944a56b7d8183dfa04761247b5b760fdef.tar.gz |
Split guid/0 in guid/0 and the faster fast_guid/0.
The first function works like the old one (hashes the {serial, counter} each
time.
The second function (fast_guid/0) hashes the serial once, and the XORs it with
the counter each time a new guid is needed. Thus, it is more predictable but
should not produce less unique guids.
If the fast function is used when generating ids for messages, it leads to a
considerable speedup when testing with BroadcastMain (from 67k msg/s to
75k msg/s).
Diffstat (limited to 'src/rabbit_basic.erl')
-rw-r--r-- | src/rabbit_basic.erl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rabbit_basic.erl b/src/rabbit_basic.erl index b116821c..0af35134 100644 --- a/src/rabbit_basic.erl +++ b/src/rabbit_basic.erl @@ -139,7 +139,7 @@ message(XName, RoutingKey, #content{properties = Props} = DecodedContent) -> {ok, #basic_message{ exchange_name = XName, content = strip_header(DecodedContent, ?DELETED_HEADER), - id = rabbit_guid:guid(), + id = rabbit_guid:fast_guid(), is_persistent = is_message_persistent(DecodedContent), routing_keys = [RoutingKey | header_routes(Props#'P_basic'.headers)]}} |