-
-
Notifications
You must be signed in to change notification settings - Fork 461
Remove vendored code and upgrade to async profiler 4.2 #4856
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
|
@sentry review |
|
@cursor review |
...y-async-profiler/src/main/java/io/sentry/asyncprofiler/profiling/JavaContinuousProfiler.java
Show resolved
Hide resolved
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 806307f | 357.85 ms | 424.64 ms | 66.79 ms |
| ee747ae | 554.98 ms | 611.50 ms | 56.52 ms |
| 17a0955 | 372.53 ms | 446.70 ms | 74.17 ms |
| 2124a46 | 319.19 ms | 415.04 ms | 95.85 ms |
| 9fbb112 | 404.51 ms | 475.65 ms | 71.14 ms |
| b6702b0 | 395.86 ms | 409.98 ms | 14.12 ms |
| ee747ae | 357.79 ms | 421.84 ms | 64.05 ms |
| 27d7cf8 | 314.17 ms | 347.00 ms | 32.83 ms |
| 9fbb112 | 361.43 ms | 427.57 ms | 66.14 ms |
| 96449e8 | 361.30 ms | 423.39 ms | 62.09 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 806307f | 1.58 MiB | 2.10 MiB | 533.42 KiB |
| ee747ae | 1.58 MiB | 2.10 MiB | 530.95 KiB |
| 17a0955 | 1.58 MiB | 2.10 MiB | 533.20 KiB |
| 2124a46 | 1.58 MiB | 2.12 MiB | 551.51 KiB |
| 9fbb112 | 1.58 MiB | 2.11 MiB | 539.18 KiB |
| b6702b0 | 1.58 MiB | 2.12 MiB | 551.79 KiB |
| ee747ae | 1.58 MiB | 2.10 MiB | 530.95 KiB |
| 27d7cf8 | 1.58 MiB | 2.12 MiB | 549.42 KiB |
| 9fbb112 | 1.58 MiB | 2.11 MiB | 539.18 KiB |
| 96449e8 | 1.58 MiB | 2.11 MiB | 539.35 KiB |
Previous results on branch: feat/profiling-remove-vendored-code
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 685ed62 | 317.43 ms | 363.16 ms | 45.74 ms |
| 04a034e | 325.24 ms | 415.40 ms | 90.16 ms |
| c4e9681 | 339.70 ms | 445.26 ms | 105.56 ms |
| 4bbb5eb | 349.94 ms | 442.94 ms | 93.00 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 685ed62 | 1.58 MiB | 2.12 MiB | 551.51 KiB |
| 04a034e | 1.58 MiB | 2.12 MiB | 551.51 KiB |
| c4e9681 | 1.58 MiB | 2.12 MiB | 551.56 KiB |
| 4bbb5eb | 1.58 MiB | 2.12 MiB | 551.57 KiB |
adinauer
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.
Nice! Left some minor comments.
|
|
||
| ### Features | ||
|
|
||
| - Remove vendored code and upgrade to async profiler 4.2 ([#4856](https://github.com/getsentry/sentry-java/pull/4856)) |
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.
We should mention that this means compatibility with newer JDK versions.
| "start,jfr,event=wall,nobatch,interval=%s,file=%s", | ||
| profilingIntervalMicros, filename); | ||
|
|
||
| logger.log(SentryLevel.INFO, command); |
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.
Do we want to remove this again? Or lower log level? I imagine it's quite spammy.
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.
Ah, yes, oversight on my part. Will remove this
# Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md
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.
Bug: JFR Reader: Upstream Incompatibility
The code references jfr.javaThreads which was a Sentry-specific modification to the vendored JFR reader but doesn't exist in the upstream one.jfr.JfrReader library. This will cause a compilation error or runtime failure when trying to resolve Java thread IDs from native thread IDs.
sentry-async-profiler/src/main/java/io/sentry/asyncprofiler/convert/JfrAsyncProfilerToSentryProfileConverter.java#L118-L123
Lines 118 to 123 in c6df8f0
| private long resolveThreadId(int eventId) { | |
| Long javaThreadId = jfr.javaThreads.get(eventId); | |
| return javaThreadId != null ? javaThreadId : UNKNOWN_THREAD_ID; | |
| } | |
| private void processThreadMetadata(Event event, long threadId) { |
# Conflicts: # CHANGELOG.md
📜 Description
Upgrade to async-profiler 4.2. This allows us to remove all vendored code from the converter and also adds support for jdk 23+.
💡 Motivation and Context
💚 How did you test it?
📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps