bugsnag / bugsnag-android

BugSnag crash monitoring and reporting tool for Android apps
https://www.bugsnag.com/platforms/android/
Other
1.18k stars 205 forks source link

Don't use strings for `BreadcrumbType` in NDK #2018

Closed lemnik closed 4 months ago

lemnik commented 4 months ago

Goal

Small reduction in overhead when leaving breadcrumbs: use integers to represent the BreadcrumbType instead of strings.

Design

While the string values for BreadcrumbType on the Java/Kotlin code were constants, they required a call to GetStringUTFChars and strcmp to evaluate which enum value to use.

The new implementation uses an exhaustive when which means:

Testing

Relied on existing tests.

bugsnagbot commented 4 months ago

Android notifier sizes

Format Size impact of Bugsnag (kB) Size impact of Bugsnag when Minified (kB)
APK 1844.24 1668.28
arm64_v8a 626.95 450.82
armeabi_v7a 561.42 385.29
x86 704.75 524.53
x86_64 671.99 495.86

Generated by :no_entry_sign: Danger