diff options
author | Matthias Radestock <matthias@rabbitmq.com> | 2011-10-03 10:18:48 +0100 |
---|---|---|
committer | Matthias Radestock <matthias@rabbitmq.com> | 2011-10-03 10:18:48 +0100 |
commit | 848d179a875824ec77d1330fb6d3ac39d5bf31e2 (patch) | |
tree | cec6cd80c6b640c34f992f5ecbf95ace10fe9b17 /src/rabbit_router.erl | |
parent | e233664631e07df273082f8b92d92e083bb645c5 (diff) | |
download | rabbitmq-server-848d179a875824ec77d1330fb6d3ac39d5bf31e2.tar.gz |
optimise resource lookup
This is worth ~2% in "MCM -a" when running with two Erlang schedulers,
and drops rabbit_misc:dirty_read/1 from #21 to #49 in the fprof
analysis of the publisher channel.
Diffstat (limited to 'src/rabbit_router.erl')
-rw-r--r-- | src/rabbit_router.erl | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/rabbit_router.erl b/src/rabbit_router.erl index 36fdb203..e9c4479a 100644 --- a/src/rabbit_router.erl +++ b/src/rabbit_router.erl @@ -108,12 +108,7 @@ check_delivery(_ , true, {_ , []}) -> {not_delivered, []}; check_delivery(_ , _ , {_ , Qs}) -> {routed, Qs}. %% Normally we'd call mnesia:dirty_read/1 here, but that is quite -%% expensive due to general mnesia overheads (figuring out table types -%% and locations, etc). We get away with bypassing these because we -%% know that the table -%% - is not the schema table -%% - has a local ram copy -%% - does not have any indices +%% expensive for the reasons explained in rabbit_misc:dirty_read/1. lookup_qpids(QNames) -> lists:foldl(fun (QName, QPids) -> case ets:lookup(rabbit_queue, QName) of |