-
Notifications
You must be signed in to change notification settings - Fork 208
Description
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:
measureTime {
bugsnagClient.leaveBreadcrumb(message, metadata, MANUAL)
}
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
- Android version: Android Q (API 29)
- Bugsnag version: 5.28.3
- Physical device: Square hardware with sdm660 SOC