Optimize attaching the debug probes - #4619
Open
dkhalanskyjb wants to merge 2 commits into
Open
Conversation
dkhalanskyjb
force-pushed
the
dkhalanskyjb/optimize-debug-probes-attach
branch
from
June 2, 2026 12:27
0d30d40 to
95460b5
Compare
I see a notable speed improvement even without any benchmarks,
simply by running `DebugProbes.withDebugProbes { }` in a loop.
dkhalanskyjb
force-pushed
the
dkhalanskyjb/optimize-debug-probes-attach
branch
from
June 2, 2026 12:55
95460b5 to
57c7902
Compare
dkhalanskyjb
marked this pull request as ready for review
June 2, 2026 12:59
fzhinkin
self-requested a review
June 12, 2026 19:15
qwwdfsad
self-requested a review
June 25, 2026 09:44
qwwdfsad
approved these changes
Jun 25, 2026
qwwdfsad
left a comment
Member
There was a problem hiding this comment.
Nice catch!
Nit -- please consider explaining what has been done in the commit message
| } | ||
| } | ||
|
|
||
| private val targetClassLoader = Class.forName(classNameToOverride).classLoader |
Member
There was a problem hiding this comment.
These things probably belong to ByteBuddyDynamicAttach's companion, potentially as @JvmStatic encapsulation-wise.
Beware of targetClassLoader computed eagerly in that case though
dkhalanskyjb
force-pushed
the
dkhalanskyjb/optimize-debug-probes-attach
branch
from
July 13, 2026 11:04
edd5ade to
fb09810
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I see a notable speed improvement even without any benchmarks, simply by running
DebugProbes.withDebugProbes { }in a loop.As I see, the change should be completely transparent for the user.
Class.forNameused to run with the class loader of theByteBuddyDynamicAttachclass, which itself is loaded byByteBuddyDynamicAttach. This hasn't changed—there is still no other code that can accessByteBuddyDynamicAttach, and transitively, theAttachKtfields.