Bug 683534

Summary: Performance bottleneck in class QueueListeners: replace std::vector with std::deque
Product: Red Hat Enterprise MRG Reporter: Kim van der Riet <kim.vdriet>
Component: qpid-cppAssignee: Kim van der Riet <kim.vdriet>
Status: NEW --- QA Contact: MRG Quality Engineering <mrgqe-bugs>
Severity: unspecified Docs Contact:
Priority: medium    
Version: DevelopmentCC: iboverma, jross
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Kim van der Riet 2011-03-09 16:33:34 UTC
It has been observed that when a large number of subscribers (1000s) exist on a queue that performance is noticeably degraded, even though only one of the subscribers is receiving each message (round-robin). In particular, QueueListeners::populate() and QueueListeners::addListener() are both slow in these cases.

Since both the listeners and browsers are operating as FIFOs, it seems inefficient to use std::vector in this role since popping from the front of a vector is not supported directly and using erase(begin()) is very inefficient.

Initial tests show that simply replacing the std::vector with a std::deque and erase(begin()) with pop_front() improves the 1000 sub case by a factor of 2 and the 10000 case by a factor of 5. Another factor of 2 is possible if the duplicate sub check in QueueListeners::add() can be removed, but tests are still ongoing for this change.