summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2011-11-30 10:27:57 +0000
committerMatthias Radestock <matthias@rabbitmq.com>2011-11-30 10:27:57 +0000
commit2dc193878d2abd8cc8b0d70f3fb8d9cb27aa1351 (patch)
tree9a08f55f775b9ba899df20ba5e2613416acb199e /include
parent8d9e6661f74372f26c244f0cf7b389dc64e9983d (diff)
downloadrabbitmq-server-git-2dc193878d2abd8cc8b0d70f3fb8d9cb27aa1351.tar.gz
reduce time complexity of binding removal on queue deletion
from O(n^2) to O(n). The solution comes in two parts: 1) a new table, rabbit_topic_trie_node, to explicitly track edge and binding counts of nodes in the trie. This eliminates expensive mnesia:match_object operations to determine these counts when needed. 2) table-scope write locks to eliminate row-level locking, which is expensive when there are many such locks in a single transaction
Diffstat (limited to 'include')
-rw-r--r--include/rabbit.hrl2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/rabbit.hrl b/include/rabbit.hrl
index a603886c4b..d81b82dbbc 100644
--- a/include/rabbit.hrl
+++ b/include/rabbit.hrl
@@ -56,9 +56,11 @@
-record(binding, {source, key, destination, args = []}).
-record(reverse_binding, {destination, key, source, args = []}).
+-record(topic_trie_node, {trie_node, edge_count, binding_count}).
-record(topic_trie_edge, {trie_edge, node_id}).
-record(topic_trie_binding, {trie_binding, value = const}).
+-record(trie_node, {exchange_name, node_id}).
-record(trie_edge, {exchange_name, node_id, word}).
-record(trie_binding, {exchange_name, node_id, destination}).