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

[QA] Move NDK scope sync to background thread #3754

Merged
merged 5 commits into from
Oct 14, 2024
Merged

Conversation

markushi
Copy link
Member

@markushi markushi commented Oct 4, 2024

📜 Description

Utilizes our ExecutorService to perform NDK scope sync (and it's JSON serialization) on a background thread.
This will cause an async scope sync, meaning if e.g. .setUser() returns, the value is not visible on the NDK side right away. The upside is faster execution.

If we see there's demand for an in-sync solution, we can introduce a flag later.

Motivation

Closes #3046

💚 How did you test it?

Extended tests

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

Copy link
Contributor

github-actions bot commented Oct 4, 2024

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against b3f16f7

Copy link
Member

@romtsn romtsn left a comment

Choose a reason for hiding this comment

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

LGTM! Just thinking if we should introduce an ndk-specific executor here? Our default executor does too many things already 😅

Copy link
Contributor

github-actions bot commented Oct 4, 2024

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 432.26 ms 490.80 ms 58.54 ms
Size 1.70 MiB 2.35 MiB 667.90 KiB

Previous results on branch: feat/async-ndk-scope-sync

Startup times

Revision Plain With Sentry Diff
3a599c8 662.49 ms 748.14 ms 85.65 ms
4139c9c 425.58 ms 460.88 ms 35.29 ms
57a3722 394.68 ms 462.96 ms 68.28 ms
d28a94e 411.56 ms 428.00 ms 16.44 ms

App size

Revision Plain With Sentry Diff
3a599c8 1.70 MiB 2.35 MiB 661.36 KiB
4139c9c 1.70 MiB 2.35 MiB 661.36 KiB
57a3722 1.70 MiB 2.35 MiB 667.55 KiB
d28a94e 1.70 MiB 2.35 MiB 661.36 KiB

@markushi markushi merged commit a9c767e into main Oct 14, 2024
26 checks passed
@markushi markushi deleted the feat/async-ndk-scope-sync branch October 14, 2024 11:32
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.

Offload NDK Scope sync to background thread
3 participants