Repository navigation
Read the clock fewer times during message routing - #408
Merged
wolfstudy merged 1 commit intoDec 2, 2020
Merged
Conversation
dferstay
force-pushed
the
fewer-calls-to-time-during-routing
branch
2 times, most recently
from
December 2, 2020 05:34
3105115 to
a398260
Compare
merlimat
approved these changes
Dec 2, 2020
Member
|
@dferstay Can you fix the ci error? |
Previously, we read the system clock twice for each event unless we switched partitions early due to reaching `maxBatchingMessages` or `maxBatchingSize`. Now, we read the clock once every `maxBatchingMessages / 100` messages. This improves performance (especially for larger batch sizes) as the router function is called for every message produced. A bench test of the default router was added; results are below: ``` name old time/op new time/op delta DefaultRouter 106ns ± 0% 16ns ± 1% -84.94% (p=0.016 n=4+5) DefaultRouter-4 106ns ± 0% 16ns ± 0% ~ (p=0.079 n=4+5) ``` Signed-off-by: Daniel Ferstay <[email protected]>
dferstay
force-pushed
the
fewer-calls-to-time-during-routing
branch
from
December 2, 2020 06:04
a398260 to
f32709f
Compare
wolfstudy
self-requested a review
December 2, 2020 06:44
wolfstudy
approved these changes
Dec 2, 2020
tisonkun
pushed a commit
to tisonkun/pulsar-client-go
that referenced
this pull request
Aug 15, 2023
…ache#408) * Add command topic Deduplication(streamnative/pulsar-admin-go#246) - pulsarctl topics get-deduplication [topic] - pulsarctl topics set-deduplication [topic] -e - pulsarctl topics remove-deduplication [topic] * Modify prompt Signed-off-by: limingnihao <[email protected]>
tisonkun
pushed a commit
to tisonkun/pulsar-client-go
that referenced
this pull request
Aug 15, 2023
* Add command topic Deduplication(streamnative/pulsarctl#246) - pulsarctl topics get-deduplication [topic] - pulsarctl topics set-deduplication [topic] -e - pulsarctl topics remove-deduplication [topic] * Modify prompt Signed-off-by: limingnihao <[email protected]>
tisonkun
pushed a commit
that referenced
this pull request
Aug 16, 2023
* Add command topic Deduplication(streamnative/pulsarctl#246) - pulsarctl topics get-deduplication [topic] - pulsarctl topics set-deduplication [topic] -e - pulsarctl topics remove-deduplication [topic] * Modify prompt Signed-off-by: limingnihao <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, we read the system clock twice for each event unless we
switched partitions early due to reaching
maxBatchingMessagesormaxBatchingSize.Now, we read the clock once every
maxBatchingMessages / 100messages.This improves performance (especially for larger batch sizes) as the
router function is called for every message produced.
A bench test of the default router was added; results are below:
Signed-off-by: Daniel Ferstay [email protected]
Motivation
The default_router reads the system clock twice for every message routed in the production code path. When testing at scale with larger batch sizes the amount of time spent reading the system clock during message routing shows up in pprof profiles.
Modifications
This change modifies the default router to read the system clock once for every
maxBatchingMessages / 100messages routed.A bench test of the default router was added to verify that the change yields a speedup.
Verifying this change
This change is a trivial rework / code cleanup without any test coverage.
Does this pull request potentially affect one of the following parts:
Documentation