Bug 683534 - Performance bottleneck in class QueueListeners: replace std::vector with std::deque
Summary: Performance bottleneck in class QueueListeners: replace std::vector with std:...
Keywords:
Status: NEW
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-cpp
Version: Development
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: ---
: ---
Assignee: Kim van der Riet
QA Contact: MRG Quality Engineering
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-03-09 16:33 UTC by Kim van der Riet
Modified: 2021-03-16 12:47 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.