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

Reduce cost of rate lookup in RateByServiceSampler #2071

Merged
merged 1 commit into from Nov 13, 2020

Conversation

richardstartin
Copy link
Member

@richardstartin richardstartin commented Nov 12, 2020

The idea here is that it's much cheaper to construct a small wrapper for lookups than to create a new string, because it allocates less memory, doesn't need to do the array copies, and doesn't invalidate the cached hash code. This comes at the cost of needing to parse the responses from the agent. Also treats the default rate specially, instead of needing to lookup in the map twice.

@richardstartin richardstartin requested a review from a team as a code owner November 12, 2020 22:39
@richardstartin richardstartin force-pushed the rgs/rate-by-service-optimisation branch 5 times, most recently from c4a788c to dab69c5 Compare November 12, 2020 23:09
@richardstartin richardstartin merged commit 853bf9c into master Nov 13, 2020
@richardstartin richardstartin deleted the rgs/rate-by-service-optimisation branch November 13, 2020 16:36
@github-actions github-actions bot added this to the 0.68.0 milestone Nov 13, 2020
@PerfectSlayer PerfectSlayer added tag: performance Performance related changes and removed efficiency labels Jun 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tag: performance Performance related changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants