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

NDK metadata iterator #2035

Closed lemnik closed 3 months ago

lemnik commented 3 months ago

Goal

Reduce the overhead of copying Metadata into the NDK layer. This PR includes some minor fixes to existing tests.

Design

Directly iterate over the Map.entrySet instead of first copying all of the keys to a temporary ArrayList. Since the most common Map implementations maintain their data in Map.Entry objects, this has significantly lower overheads and complexity than the previous pattern.

Testing

Relied on existing tests.

bugsnagbot commented 3 months ago

Android notifier sizes

Format Size impact of Bugsnag (kB) Size impact of Bugsnag when Minified (kB)
APK 1852.08 1675.96
arm64_v8a 631.04 450.82
armeabi_v7a 565.51 385.29
x86 704.75 528.62
x86_64 676.09 495.86

Generated by :no_entry_sign: Danger

Cawllec commented 3 months ago

I've rebased and re-tested using the instrumentation tests. They now pass with this change.