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

Avoid compiling regexes in ObjectJsonStreamer #2008

Merged
merged 1 commit into from
Apr 10, 2024

Conversation

lemnik
Copy link
Contributor

@lemnik lemnik commented Apr 9, 2024

Goal

Reduce the overhead of constructing ObjectJsonStreamer instances (and therefore leaving complex breadcrumbs) by sharing the default redactedKeys (which is immutable).

Design

An ObjectJsonStreamer is allocated internally each time a breadcrumb metadata item needs to be JSON encoded early (because it is too complex for the NDK layer to handle directly). Each of these was causing the default redactedKeys pattern to be compiled. Since the default redactedKeys set is immutable, it can be safely shared instead.

Testing

Relied on existing tests.

@lemnik lemnik requested a review from YYChen01988 April 9, 2024 17:09
@bugsnagbot
Copy link
Collaborator

bugsnagbot commented Apr 9, 2024

Android notifier sizes

Format Size impact of Bugsnag (kB) Size impact of Bugsnag when Minified (kB)
APK 1843.96 1668.06
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

Copy link
Contributor

@YYChen01988 YYChen01988 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lemnik lemnik force-pushed the lemnik/static-default-redacted-keys branch from 980e1eb to 081d194 Compare April 10, 2024 07:42
@lemnik lemnik merged commit 4679038 into next Apr 10, 2024
26 checks passed
@lemnik lemnik deleted the lemnik/static-default-redacted-keys branch April 10, 2024 08:03
lemnik added a commit that referenced this pull request Apr 10, 2024
@YYChen01988 YYChen01988 mentioned this pull request Apr 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.

3 participants