-
-
Notifications
You must be signed in to change notification settings - Fork 444
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
Various fixes to instrumentations running on the main thread #4039
Conversation
Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
00c8eeb | 415.32 ms | 428.08 ms | 12.76 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
00c8eeb | 1.70 MiB | 2.36 MiB | 671.98 KiB |
Previous results on branch: rz/fix/user-interaction-tracing
Startup times
Revision | Plain | With Sentry | Diff |
---|---|---|---|
add3e5a | 449.39 ms | 481.34 ms | 31.95 ms |
4e86894 | 429.12 ms | 479.11 ms | 49.99 ms |
95322cb | 410.15 ms | 489.38 ms | 79.23 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
add3e5a | 1.65 MiB | 2.31 MiB | 677.51 KiB |
4e86894 | 1.65 MiB | 2.31 MiB | 677.48 KiB |
95322cb | 1.65 MiB | 2.31 MiB | 677.51 KiB |
sentry/src/main/java/io/sentry/instrumentation/file/SentryFileInputStream.java
Show resolved
Hide resolved
@@ -274,6 +276,15 @@ class SentryFileInputStreamTest { | |||
assertEquals(false, fileIOSpan.data[SpanDataConvention.BLOCKED_MAIN_THREAD_KEY]) | |||
assertNull(fileIOSpan.data[SpanDataConvention.CALL_STACK_KEY]) | |||
} | |||
|
|||
@Test | |||
fun `when tracing is disabled does not instrument the stream`() { |
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.
should we add the same test in SentryFileOutputStreamTest
?
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.
yeah I can add one!
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.
just small details, but nice
Superseded by #4051 |
📜 Description
Here are just some preventive measure that will make less code/instructions to run on the main thread:
Window.Callback
to not be aSentryWindowCallback
already to prevent multiple callbacks running simultaneouslyrequireNonNull
calls as they are redundant (we doinstanceof
checks later on anyway)Before
After
💡 Motivation and Context
Internal customer discussions
💚 How did you test it?
automated
📝 Checklist
sendDefaultPII
is enabled.🔮 Next steps