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 | f9a2b1554f07742c8ff4c8d51f2c61be761db85e (patch) | |
| tree | 9efd8bc2880ced37170cf65a9343cfc43df8db3e | |
| parent | ce658f9bbab8ef4df386b4845a5705a8f0728ff9 (diff) | |
| download | rabbitmq-server-git-f9a2b1554f07742c8ff4c8d51f2c61be761db85e.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 exchange
| -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 5cd15a9462..75196bc0d4 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)). %%-------------------------------------------------------------------- |
