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

Avoid allocating lambda in PercentileTimer.computeIfAbsent #1128

Merged
merged 2 commits into from
Mar 22, 2024

Conversation

kilink
Copy link
Member

@kilink kilink commented Mar 20, 2024

PercentileTimer.computeIfAbsent would delegate to Utils.computeIfAbsent, which actually eagerly calls get and then putIfAbsent if the timer is not in the underlying map. Just directly do that to avoid needing to allocate a lambda in the case the timer is present.

PercentileTimer.computeIfAbsent would delegate to Utils.computeIfAbsent, which actually
eagerly calls get and then putIfAbsent if the timer is not in the underlying map. Just directly
do that to avoid needing to allocate a lambda in the case the timer is present.
@brharrington brharrington added this to the 1.7.10 milestone Mar 20, 2024
@brharrington brharrington merged commit 921da23 into Netflix:main Mar 22, 2024
1 check passed
@kilink kilink deleted the percentile-timer-compute-if-absent branch April 4, 2024 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants