-
Notifications
You must be signed in to change notification settings - Fork 205
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
Client.leaveBreadcrumb is slow() #1974
Comments
Hi @pyricau, Thanks very much for the detailed issue, you're absolutely right that This is an area we're actively working on at the moment (the NDK plugin also doesn't obey the For now it’s worth avoiding leaving “complex” breadcrumb metadata where it can be avoided, while we work to reduce the overhead more generally. |
Hi again @pyricau Just to let you know we've released the first improvements to the breadcrumb performance work as part of v6.4.0. This first change will only affect breadcrumbs that have complex metadata, and was caused by a regex pattern being compiled for each metadata item instead of being shared. We're also working on some more general performance improvements that will affect all breadcrumbs synchronized to the native layer. |
thank you! |
Hi @pyricau Sorry for the slow response on this. I just wanted to let you know that we have been trying a number of further experiments to improve the performance. While we did see some marginal gains,, they were not enough to justify the additional complexity that was introduced (most roads end up back at We will continue tracking this and trying to improve this performance (we have already made significant changes in the NDK plugin to allow us some more flexibility in how we capture the data, and will continue to make further improvements). Let us know if you have any further thoughts or suggestions. |
Bug description
As measured on Square's hardware,
Client.leaveBreadcrumb()
is unreasonably slow (for what it's supposed to do, which is store a breadcrumb in a ring buffer).Data
Here are the results, based on 175 measurements:
As you can see, the duration has a wide spread (up to 1 ms!) and the mode is around 173us. Even without the worst case scenario, that's a large amount of time for just adding an entry to a ring buffer.
I started looking into this after noticing that
Client.leaveBreadcrumb()
was showing up in our simpleperf traces. Anecdotally, it seemed like the time was spent in native code, through the JNI boundary.Steps to reproduce
I measured the time it takes to call just
Client.leaveBreadcrumb()
as I navigated around our app with the following code:I speed compiled our app to ensure there's no jitting slowing things down with
adb shell cmd package compile -f -m speed com.squareup
.Then I navigated a bunch in our app, which triggered the logging of breadcrumbs
Environment
The text was updated successfully, but these errors were encountered: