Repository navigation
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Bare-metal measurements did not confirm a startup improvement. Preserve the experiment on trask-startup-indexed-unproven-20261027. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Pull request dashboard statusWaiting on reviewers · refreshed 2026-11-07 17:29 UTC Review the latest changes. Status above doesn't look right?
|
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block approval of the loaded-class matching optimization.
No open issues 🎉
What changed in this PR
Reduces javaagent startup matching overhead by filtering out impossible matches for already-loaded classes before classloader checks and full type matching.
Changes:
- Caches loaded-class hierarchy names and uses them to prefilter recognized matchers.
- Preserves original matching for possible matches, unknown matchers, and calls without a loaded class.
- Adds tests covering name and hierarchy filtering, delegate evaluation, and fallback behavior.
| File | Description |
|---|---|
javaagent-tooling/src/test/java/net/bytebuddy/agent/builder/AgentBuilderUtilTest.java |
Tests loaded-class filtering and preservation of original matching behavior. |
javaagent-tooling/src/main/java/net/bytebuddy/agent/builder/AgentBuilderUtil.java |
Adds cached hierarchy names and wraps recognized matchers with a loaded-class prefilter. |
Review effort: Balanced
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
trask
commented
Oct 29, 2026
Co-authored-by: trask <218610+trask@users.noreply.github.com>
trask
commented
Oct 29, 2026
Co-authored-by: trask <218610+trask@users.noreply.github.com>
trask
commented
Oct 29, 2026
Co-authored-by: trask <218610+trask@users.noreply.github.com>
trask
commented
Oct 29, 2026
Co-authored-by: trask <218610+trask@users.noreply.github.com>
trask
commented
Oct 29, 2026
trask
commented
Oct 29, 2026
trask
commented
Oct 29, 2026
Co-authored-by: trask <218610+trask@users.noreply.github.com>
trask
marked this pull request as ready for review
October 29, 2026 20:40
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.
Reduce startup matching work for already-loaded classes by rejecting impossible name/hierarchy matches before classloader-resource checks and full type matching. Possible matches still run the original matcher; unknown matchers and calls without a loaded class retain their existing behavior.
The benchmark tooling used for these measurements is in #21041.
Agent-added startup overhead on bare metal
The ordinary-agent startup benchmark showed a 325.0 ms / 5.19% reduction in agent-added startup overhead, from 6,263.5 ms to 5,938.5 ms.
Overhead is each agent's median startup time minus the no-agent median. The percentage reduction uses the unoptimized agent's overhead as its denominator, not total application startup time. These are differences of pooled medians, not medians of paired per-round differences.
Run 1 and run 2 each measured 20 fresh JVM starts per configuration after discarding two starts per configuration. Their overhead reductions were 4.77% and 5.28%, respectively. Configurations ran serially in rotating order each round on the same official bare-metal host. The second run reused the first run's built artifacts.
All configurations used the same pinned Spring Boot image, JDK 25.0.1, two-CPU quota, 1 GiB memory limit, and 512 MiB heap. The no-agent control omitted
-javaagent; both agents kept instrumentation and SDK enabled with exporters disabled. Filesystem/image caches were warm, and separate diagnostic JFR launches were excluded from timings.The metric is JVM uptime sampled while producing the first successful
/greetingresponse. The overhead therefore includes the agent's effects on application startup, not just time insidepremain. Results apply to this fixture on a shared host, not every application.Measured baseline
e8417286f55against optimized revisiondfcbd7d2a24. Artifacts retain all observations, commands, hashes, host identity, and profiles.