-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performance[MQB]: prevent unnecessary allocations in queue engines #390
Conversation
Signed-off-by: Evgeny Malygin <[email protected]>
Signed-off-by: Evgeny Malygin <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The allocation tables in the description seem to come different scenarios so not much of illustration, but still a good idea.
Why don't we do the same for the RelayQueueEngine
?
@@ -140,6 +140,9 @@ class RootQueueEngine BSLS_KEYWORD_FINAL : public mqbi::QueueEngine { | |||
// Throttler for when reject messages | |||
// are dumped into temp files. | |||
|
|||
QueueEngineUtil_AppsDeliveryContext d_context; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a suggestion, since this is a data member now, a bit more descriptive name to disambiguate from other (future) contexts
Signed-off-by: Evgeny Malygin <[email protected]>
Signed-off-by: Evgeny Malygin <[email protected]>
Signed-off-by: Evgeny Malygin <[email protected]>
Signed-off-by: Evgeny Malygin <[email protected]>
@@ -1238,23 +1239,21 @@ void RootQueueEngine::afterNewMessage( | |||
d_queueState_p->queue())); | |||
|
|||
// Deliver new messages to active (alive and capable to deliver) consumers | |||
d_appsDeliveryContext.d_doRepeat = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that we do reset()
when we enter the while
loop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a minor note wrt d_doRepeat = true
, a do
while
loop could look good
Signed-off-by: Evgeny Malygin <[email protected]>
Signed-off-by: Evgeny Malygin <[email protected]>
Good suggestion, applied |
Signed-off-by: Evgeny Malygin <[email protected]>
Signed-off-by: Evgeny Malygin <[email protected]>
…loomberg#390) Signed-off-by: Evgeny Malygin <[email protected]>
…loomberg#390) Signed-off-by: Evgeny Malygin <[email protected]>
…loomberg#390) Signed-off-by: Evgeny Malygin <[email protected]>
Drastically reduce the number of memory allocations in
RootQueueEngine
andRelayQueueEngine
Before:
After: