Repository navigation
Conversation
Pull request dashboard statusWaiting on the author · refreshed 2026-10-26 04:50 UTC Move out of draft to request review. Status above doesn't look right?
|
Co-authored-by: trask <218610+trask@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Optimize lazy virtual-field helper generation
Generate virtual-field helpers on first class transformation
Oct 26, 2026
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Concurrent class-loading and bootstrap-injection behavior needs human validation beyond the publication-focused unit tests.
1 open issue
What changed in this PR
Defers virtual-field helper generation until an instrumentation module first transforms a matching class, avoiding generation for unused libraries.
Changes:
- Lazily generates and atomically publishes a reusable helper bundle.
- Preserves accessor-before-implementation injection order.
- Adds laziness and concurrency tests with a dedicated unit-test runtime configuration.
| File | Description |
|---|---|
| javaagent-tooling/src/unitTests/java/io/opentelemetry/javaagent/tooling/field/FieldBackedImplementationInstallerTest.java | Adds deferred-generation and concurrent-publication tests. |
| javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/field/FieldBackedImplementationInstaller.java | Moves helper generation into transformation-time initialization. |
| javaagent-tooling/build.gradle.kts | Registers the unit-test suite and excludes conflicting runtime dependencies. |
Review effort: Balanced
trask
reviewed
Oct 26, 2026
Co-authored-by: trask <218610+trask@users.noreply.github.com>
trask
reviewed
Oct 26, 2026
Co-authored-by: trask <218610+trask@users.noreply.github.com>
trask
reviewed
Oct 26, 2026
Co-authored-by: trask <218610+trask@users.noreply.github.com>
trask
marked this pull request as ready for review
October 26, 2026 03:05
trask
approved these changes
Oct 26, 2026
trask
marked this pull request as draft
October 26, 2026 04:50
This branch has not been deployed
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.

Generate virtual-field helpers when an instrumentation module first transforms a matching class, rather than eagerly during agent startup. Libraries that never load avoid this work; libraries loaded later pay the one-time cost then.
In the Spring/JDK 25 bare-metal benchmark, median startup fell from about 4.96 s to 4.32 s in the first run and an independent confirmation, about 640 ms or 13% overall. HTTP readiness also improved by about 650 ms. These results are specific to this workload and configuration.