Performance ehnancement for TopicExchange
-----------------------------------------

                 Key: QPID-696
                 URL: https://issues.apache.org/jira/browse/QPID-696
             Project: Qpid
          Issue Type: Improvement
          Components: C++ Broker
         Environment: Any
            Reporter: Ted Ross
            Priority: Minor


The current code in TopicExchange.cpp does a heap allocation per binding, per 
message.  The following optimization removes the per-binding allocation and 
will improve performance particularly where there are many bindings on a topic 
exchange.

Index: TopicExchange.cpp
===================================================================
 
 void TopicExchange::route(Deliverable& msg, const string& routingKey, const 
FieldTable* /*args*/){
     RWlock::ScopedRlock l(lock);
+    Tokens   tokens(routingKey);
+
     for (BindingMap::iterator i = bindings.begin(); i != bindings.end(); ++i) {
-        if (i->first.match(routingKey)) {
+        if (i->first.match(tokens)) {
             Queue::vector& qv(i->second);
             for(Queue::vector::iterator j = qv.begin(); j != qv.end(); j++){
                 msg.deliverTo(*j);
             }
         }
     }
 } 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to