You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Ted Ross (JIRA)" <qp...@incubator.apache.org> on 2007/12/04 20:30:43 UTC

[jira] Created: (QPID-696) Performance ehnancement for TopicExchange

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.


[jira] Resolved: (QPID-696) Performance ehnancement for TopicExchange

Posted by "Alan Conway (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-696?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alan Conway resolved QPID-696.
------------------------------

    Resolution: Fixed

------------------------------------------------------------------------
r601051 | aconway | 2007-12-04 14:33:34 -0500 (Tue, 04 Dec 2007) | 8 lines


Patch from Ted Ross <tr...@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.

------------------------------------------------------------------------


> 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.


[jira] Closed: (QPID-696) Performance ehnancement for TopicExchange

Posted by "Ted Ross (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-696?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ted Ross closed QPID-696.
-------------------------


> 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.