Skip to content
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

NDK: Iterate over breadcrumb metadata keys directly #2022

Merged
merged 1 commit into from
Apr 29, 2024

Conversation

lemnik
Copy link
Contributor

@lemnik lemnik commented Apr 25, 2024

Goal

Remove the allocation of an ArrayList when copying the metadata for breadcrumbs.

Design

The NDK bsg_populate_crumb_metadata method now uses the Map.entrySet.iterator() instead of first copying the keys to an ArrayList and then iterating over that (using Map.get for the values). While this is a relatively trivial overhead reduction, it has the added benefit that most Map implementation optimize this form of iteration, and avoid the allocation overhead of the ArrayList.

Testing

Manual testing, and relied on existing end to end tests.

@bugsnagbot
Copy link
Collaborator

bugsnagbot commented Apr 25, 2024

Android notifier sizes

Format Size impact of Bugsnag (kB) Size impact of Bugsnag when Minified (kB)
APK 1844.32 1668.69
arm64_v8a 626.95 450.82
armeabi_v7a 561.42 385.29
x86 700.66 524.53
x86_64 671.99 495.86

Generated by 🚫 Danger

@lemnik lemnik force-pushed the PLAT-12045/iterate-ndk-metadata branch from d198004 to 874ee56 Compare April 29, 2024 09:10
… the keys to an `ArrayList` when copying the metadata into the NDK structures
@lemnik lemnik force-pushed the PLAT-12045/iterate-ndk-metadata branch from 874ee56 to 2c766a6 Compare April 29, 2024 09:39
@lemnik lemnik merged commit f1bf0f4 into next Apr 29, 2024
37 checks passed
@lemnik lemnik deleted the PLAT-12045/iterate-ndk-metadata branch April 29, 2024 13:44
@YYChen01988 YYChen01988 mentioned this pull request May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants