qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject svn commit: r601051 - /incubator/qpid/trunk/qpid/cpp/src/qpid/broker/TopicExchange.cpp
Date Tue, 04 Dec 2007 19:33:35 GMT
Author: aconway
Date: Tue Dec  4 11:33:34 2007
New Revision: 601051

URL: http://svn.apache.org/viewvc?rev=601051&view=rev
Log:

Patch from Ted Ross <tross@redhat.com>

I've been doing some work in TopicExchange and noticed an opportunity
for optimization of the route method.  The current code does a heap
allocation per binding, per message.  The optimization removes the
per-binding allocation.

Modified:
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/TopicExchange.cpp

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/TopicExchange.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/TopicExchange.cpp?rev=601051&r1=601050&r2=601051&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/TopicExchange.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/TopicExchange.cpp Tue Dec  4 11:33:34 2007
@@ -152,8 +152,9 @@
 
 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);



Mime
View raw message