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

Remove remaining threadlocals for loom support #3286

Merged
merged 6 commits into from Aug 10, 2023

Conversation

JonasKunz
Copy link
Contributor

@JonasKunz JonasKunz commented Aug 10, 2023

What does this PR do?

Replaces the remaining (Detached)ThreadLocal usages which were used for object pooling with actual object pools.
The only exception I've made is the CachedLookupKey: I've decided to keep it as a ThreadLocal because it is (a) very small and (b) used very frequently so that the object-pool management might hurt performance.

For the OkHttp-instrumentation I decided to stick with simply allocating: That StringBuffer is only allocated once per HTTP-request, meaning that it should not be a noticeable bump in allocation in comparison to the allocations done for the HTTP request execution.

Closes #3059.

Checklist

@JonasKunz JonasKunz merged commit 4f732e9 into elastic:main Aug 10, 2023
13 checks passed
APM-Agents (OLD) automation moved this from In Progress to Done Aug 10, 2023
@JonasKunz JonasKunz deleted the remove-remaining-threadlocals branch August 10, 2023 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

Virtual Thread Support
2 participants