-
-
Notifications
You must be signed in to change notification settings - Fork 452
Optimize when maxBreadcrumb is 0 #4504
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
Merged
Merged
Conversation
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
if breadcumbs is a DisabledQueue, no more processing is done (beforeBreadcrumb or scopeObservers)
added test
…ations' into fix/disabled-breadcrumbs-optimizations
stefanosiano
commented
Jun 20, 2025
@@ -862,7 +862,7 @@ public void clearAttachments() { | |||
static @NotNull Queue<Breadcrumb> createBreadcrumbsList(final int maxBreadcrumb) { | |||
return maxBreadcrumb > 0 | |||
? SynchronizedQueue.synchronizedQueue(new CircularFifoQueue<>(maxBreadcrumb)) | |||
: SynchronizedQueue.synchronizedQueue(new DisabledQueue<>()); | |||
: new DisabledQueue<>(); |
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.
I tried calling queue.add from multiple threads concurrently, and it didn't crash, so i think we it's fine to remove SynchronizedQueue
Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
22fe8fc | 460.76 ms | 492.36 ms | 31.60 ms |
8fbf5c2 | 444.50 ms | 507.49 ms | 62.99 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
22fe8fc | 1.58 MiB | 2.09 MiB | 518.69 KiB |
8fbf5c2 | 1.58 MiB | 2.09 MiB | 519.15 KiB |
# Conflicts: # CHANGELOG.md # sentry/src/test/java/io/sentry/ScopeTest.kt
romtsn
approved these changes
Jun 30, 2025
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.
📜 Description
breadcumbs queue is now a simple DisabledQueue when maxBreadcrumb is 0
if breadcumbs is a DisabledQueue, no more processing is done (beforeBreadcrumb or scopeObservers)
💡 Motivation and Context
Fixes #4334
Previously we were calling beforeBreadcrumb and scopeObservers even when maxBreadcrumbs was 0, which was useless
💚 How did you test it?
📝 Checklist
sendDefaultPII
is enabled.🔮 Next steps