-
Notifications
You must be signed in to change notification settings - Fork 3k
Reduce allocations due to ClassLoader#defineClassSourceLocation #50234
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
Conversation
|
@dmlloyd interested in your feedback on this one. |
bdef1a2 to
d80c54e
Compare
dmlloyd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
This comment has been minimized.
This comment has been minimized.
d80c54e to
c7dbaaa
Compare
c7dbaaa to
b757474
Compare
This comment has been minimized.
This comment has been minimized.
a18fb33 to
bf4a567
Compare
This comment has been minimized.
This comment has been minimized.
It will call URL#toExternalForm() for each class, which will generate again and again the same string pointing to the jar files. By introducing a specific URLStreamHandler, we are able to avoid calling URL#toExternalForm() and use a cached version of it for each JarResource. While not making a tremendous difference, it is an easy way to reduce our allocations at startup.
bf4a567 to
9882fdc
Compare
Status for workflow
|
|
What ended up being the issue with the tests? I didn't notice what changed in the PR, but maybe a missing method on the stream handler? |
It will call URL#toExternalForm() for each class, which will generate again and again the same string pointing to the jar files.
By introducing a specific URLStreamHandler, we are able to avoid calling URL#toExternalForm() and use a cached version of it for each JarResource.
While not making a tremendous difference, it is an easy way to reduce our allocations at startup.