◐ Shell
clean mode source ↗

perf(android): [SDK Overhead Reduction 3] Reuse SentryExecutorService for DeviceInfoUtil pre-caching by adinauer · Pull Request #5502 · getsentry/sentry-java

PR Stack (SDK Overhead Reduction)


📜 Description

Replace Executors.newSingleThreadExecutor() with options.getExecutorService() in DefaultAndroidEventProcessor for the DeviceInfoUtil pre-caching task. This avoids creating a dedicated thread + executor during SDK init when the SDK already has an executor service available. Also removes the executorService.shutdown() call since we don't own the shared executor.

💡 Motivation and Context

Part of the SDK Overhead Reduction stack. During Android SDK init, DefaultAndroidEventProcessor was creating its own SingleThreadExecutor just to submit one task for pre-caching device info. The SDK's executor service (SentryExecutorService) is already available at this point and can handle this work without the overhead of spinning up an additional thread pool.

💚 How did you test it?

  • ./gradlew :sentry-android-core:compileDebugUnitTestJavaWithJavac — compiles successfully
  • ./gradlew spotlessApply apiDump — no API surface changes

📝 Checklist

  • I added GH Issue ID & Linear ID
  • 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

More SDK overhead reduction PRs in this stack.

⚠️ Merge this PR using a merge commit (not squash). Only the collection branch is squash-merged into main.

#skip-changelog