[ 
https://issues.apache.org/jira/browse/DISPATCH-1642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17123896#comment-17123896
 ] 

ASF GitHub Bot commented on DISPATCH-1642:
------------------------------------------

kgiusti commented on pull request #749:
URL: https://github.com/apache/qpid-dispatch/pull/749#issuecomment-637594924


   Merged:
   https://gitbox.apache.org/repos/asf?p=qpid-dispatch.git;h=ee82acd


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Avoid extra search when adding address configs to parse tree
> ------------------------------------------------------------
>
>                 Key: DISPATCH-1642
>                 URL: https://issues.apache.org/jira/browse/DISPATCH-1642
>             Project: Qpid Dispatch
>          Issue Type: Improvement
>          Components: Router Node
>    Affects Versions: 1.12.0
>            Reporter: Ken Giusti
>            Assignee: Ken Giusti
>            Priority: Minor
>             Fix For: 1.13.0
>
>
> Configured address patterns are stored in a parse tree.  When new addresses 
> are created the code first searches the parse tree to see if the address 
> already exists in order to avoid adding duplicate addresses.   If there is no 
> duplicate the code then calls the parse tree insertion function.
> This is sub-optimal.  The likely case is that the address does not exist in 
> the parse tree.  This means the first search (for duplication) will result in 
> searching the entire tree, which devolves to O(n).
> Currently the parse tree insertion code resolves duplication by replacing the 
> existing node's data with the new data.  If instead we treated this as a 
> duplication error and avoided the insertion we could avoid the extra lookup 
> and just let the insertion code do the duplication check for us (single pass).
> This lookup then insert pattern is used in agent_config_address.c and 
> route_control.c.  Search for calls to qd_parse_tree_get_pattern().
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org

Reply via email to