Skip to content

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

@github-actions
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
romtsn added a commit that referenced this pull request Jul 8, 2025
* perf(modules): Pre-load modules on a background thread

* Changelog

* Use a simple Thread instead of executor service
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