Skip to content

perf(modules): Pre-load modules on a background thread #4348

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

Merged
merged 4 commits into from
Apr 22, 2025

Conversation

romtsn
Copy link
Member

@romtsn romtsn commented Apr 22, 2025

📜 Description

  • Pre-load modules on a background thread upon initialization so we don't need to load them when an error/crash happens (could be on the main thread)
  • Fix cachedModules were not thread-safe

💡 Motivation and Context

An actual ANR from GPC originating in UncaughtExceptionHandler
https://play.google.com/sdk-console/accounts/3062283563667932501/sdks/5766124106675877123/crashes/44125318/details

💚 How did you test it?

Manually + existing tests

📝 Checklist

  • [] 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.
  • I updated the wizard 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 Apr 22, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 421.51 ms 470.70 ms 49.19 ms
Size 1.58 MiB 2.08 MiB 507.33 KiB

Previous results on branch: rz/perf/modules-preload

Startup times

Revision Plain With Sentry Diff
7b2ad27 404.76 ms 444.04 ms 39.29 ms

App size

Revision Plain With Sentry Diff
7b2ad27 1.58 MiB 2.08 MiB 507.38 KiB

@romtsn romtsn merged commit 078ca0d into main Apr 22, 2025
39 checks passed
@romtsn romtsn deleted the rz/perf/modules-preload branch April 22, 2025 13:08
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.

2 participants