diff options
author | Matthew Sackman <matthew@rabbitmq.com> | 2010-06-30 11:46:59 +0100 |
---|---|---|
committer | Matthew Sackman <matthew@rabbitmq.com> | 2010-06-30 11:46:59 +0100 |
commit | eb538fe4426b87938f3150cd6421a91b96887b6f (patch) | |
tree | 9efd8bc2880ced37170cf65a9343cfc43df8db3e | |
parent | 5055970340ddb7ac268d8a5b13888546a31ed7b5 (diff) | |
download | rabbitmq-server-bug22392.tar.gz |
As predicted, changing this from sets:from_list/sets:fold to lists:usort/lists:foldl has a decent performance improvement, moving from being able to sustain 8kHz on a topic exchang to 8.5kHz on a topic exchangebug22392
-rw-r--r-- | src/rabbit_router.erl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rabbit_router.erl b/src/rabbit_router.erl index 5cd15a94..75196bc0 100644 --- a/src/rabbit_router.erl +++ b/src/rabbit_router.erl @@ -90,13 +90,13 @@ match_routing_key(Name, RoutingKey) -> lookup_qpids(mnesia:dirty_select(rabbit_route, [{MatchHead, [], ['$1']}])). lookup_qpids(Queues) -> - sets:fold( + lists:foldl( fun (Key, Acc) -> case mnesia:dirty_read({rabbit_queue, Key}) of [#amqqueue{pid = QPid}] -> [QPid | Acc]; [] -> Acc end - end, [], sets:from_list(Queues)). + end, [], lists:usort(Queues)). %%-------------------------------------------------------------------- |