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

[Performance] Optimize NamespaceBundle.toString() which is on the hot path #9976

Merged

Conversation

lhotari
Copy link
Member

@lhotari lhotari commented Mar 19, 2021

Motivation

  • This is on the hot path of ownership checks for topics

  • also optimize getBundleRange() although the method doesn't seem to be on hot paths

    • it's more consistent with the change for toString() in NamespaceBundle class

Modifications

Add final fields for pre-calculating the values returned by toString and getBundleRange methods

… path

- This is on the hot path of ownership checks for topics

- also optimize getBundleRange() although the method doesn't seem to be on hot paths
  - it's more consistent with the change for toString() in NamespaceBundle class
@lhotari
Copy link
Member Author

lhotari commented Mar 19, 2021

/pulsarbot run-failure-checks

Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

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

LGTM

@lhotari
Copy link
Member Author

lhotari commented Mar 19, 2021

/pulsarbot run-failure-checks

@lhotari
Copy link
Member Author

lhotari commented Mar 19, 2021

/pulsarbot run-failure-checks

2 similar comments
@lhotari
Copy link
Member Author

lhotari commented Mar 19, 2021

/pulsarbot run-failure-checks

@lhotari
Copy link
Member Author

lhotari commented Mar 20, 2021

/pulsarbot run-failure-checks

@merlimat merlimat added the type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages label Mar 21, 2021
@merlimat merlimat added this to the 2.8.0 milestone Mar 21, 2021
@merlimat merlimat merged commit 9546b3b into apache:master Mar 21, 2021
yangl pushed a commit to yangl/pulsar that referenced this pull request Mar 22, 2021
… path (apache#9976)

- This is on the hot path of ownership checks for topics

- also optimize getBundleRange() although the method doesn't seem to be on hot paths
  - it's more consistent with the change for toString() in NamespaceBundle class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

None yet

4 participants