Skip to content
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

[improve][broker] Pin executor to dispatcher and StreamingEntryReader to cache the string hashing #18566

Merged
merged 1 commit into from
Nov 28, 2022

Conversation

AnonHxy
Copy link
Contributor

@AnonHxy AnonHxy commented Nov 22, 2022

Motivation

Inspired by #18078, Instead of hashing the string each, pin the thread and always use the same, for a given dispatcher instance, also StreamingEntryReader.

Modifications

Instead of hashing the string each, pin the thread and always use the same, for a given dispatcher instance, also StreamingEntryReader.

Verifying this change

  • Make sure that the change passes the CI checks.

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository: AnonHxy#18

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Nov 22, 2022
@AnonHxy AnonHxy self-assigned this Nov 23, 2022
@AnonHxy AnonHxy added this to the 2.12.0 milestone Nov 23, 2022
@AnonHxy AnonHxy added the type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages label Nov 23, 2022
Copy link
Member

@mattisonchao mattisonchao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@AnonHxy
Copy link
Contributor Author

AnonHxy commented Nov 23, 2022

@Jason918 @merlimat @Technoboy- PTAL

@codecov-commenter
Copy link

codecov-commenter commented Nov 24, 2022

Codecov Report

Merging #18566 (0d4220f) into master (b579bb8) will increase coverage by 2.08%.
The diff coverage is 25.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #18566      +/-   ##
============================================
+ Coverage     47.51%   49.60%   +2.08%     
- Complexity    10520    10803     +283     
============================================
  Files           698      698              
  Lines         68079    68084       +5     
  Branches       7280     7280              
============================================
+ Hits          32351    33774    +1423     
+ Misses        32151    30654    -1497     
- Partials       3577     3656      +79     
Flag Coverage Δ
unittests 49.60% <25.00%> (+2.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ersistentStreamingDispatcherMultipleConsumers.java 0.00% <0.00%> (ø)
...istentStreamingDispatcherSingleActiveConsumer.java 0.00% <0.00%> (ø)
...ervice/streamingdispatch/StreamingEntryReader.java 0.00% <0.00%> (ø)
...tent/PersistentDispatcherSingleActiveConsumer.java 59.37% <75.00%> (-0.50%) ⬇️
...ar/broker/loadbalance/impl/BundleSplitterTask.java 60.00% <0.00%> (-17.78%) ⬇️
.../apache/pulsar/broker/admin/impl/PackagesBase.java 54.12% <0.00%> (-13.77%) ⬇️
.../pulsar/broker/service/SharedConsumerAssignor.java 68.51% <0.00%> (-9.26%) ⬇️
...lsar/broker/loadbalance/impl/ThresholdShedder.java 38.56% <0.00%> (-9.16%) ⬇️
...er/mledger/impl/ManagedLedgerFactoryMBeanImpl.java 63.41% <0.00%> (-4.88%) ⬇️
...ction/buffer/impl/TransactionBufferClientImpl.java 76.74% <0.00%> (-4.66%) ⬇️
... and 104 more

@AnonHxy AnonHxy force-pushed the pin_executor_dispatcher branch from 0b60bd6 to 77bef42 Compare November 24, 2022 12:31
@AnonHxy AnonHxy force-pushed the pin_executor_dispatcher branch from 77bef42 to 0d4220f Compare November 27, 2022 15:21
@AnonHxy AnonHxy merged commit 63e452b into apache:master Nov 28, 2022
labuladong pushed a commit to labuladong/pulsar that referenced this pull request Nov 28, 2022
lifepuzzlefun pushed a commit to lifepuzzlefun/pulsar that referenced this pull request Dec 9, 2022
lifepuzzlefun pushed a commit to lifepuzzlefun/pulsar that referenced this pull request Jan 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-not-needed Your PR changes do not impact docs ready-to-test type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants