-
-
Notifications
You must be signed in to change notification settings - Fork 465
perf(breadcrumbs): Make SystemEventsBreadcrumbsIntegration faster #4330
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
| // in theory this should be ThreadLocal, but we won't have more than 1 thread accessing it, | ||
| // so we save some memory here and CPU cycles. 64 is because all intent actions we subscribe for | ||
| // are less than 64 chars. We also don't care about encoding as those are always UTF. | ||
| // TODO: _MULTI_THREADED_EXECUTOR_ |
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.
decided to mark things that depend on the single-threaded executor from now on so we won't shoot ourselves in the foot if we ever gonna switch to a multi-threaded one 😅
Performance metrics 🚀
|
...ry-android-core/src/main/java/io/sentry/android/core/SystemEventsBreadcrumbsIntegration.java
Show resolved
Hide resolved
stefanosiano
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!
📜 Description
The PR attempts to make
SystemEventsBreadcrumbsIntegrationfaster by:getStringAfterDotby using a pre-allocated buffer and iterating from the end of the string until the first dot to create a String after that. This yielded ~2x faster results on Android (10k iterations x 3 times):💡 Motivation and Context
💚 How did you test it?
📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps