qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alan Conway (JIRA)" <qpid-...@incubator.apache.org>
Subject [jira] Resolved: (QPID-696) Performance ehnancement for TopicExchange
Date Tue, 04 Dec 2007 19:40:43 GMT

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

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


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


Mime
View raw message