Skip to content

perf(android): [SDK Overhead Reduction 3] Reuse SentryExecutorService for DeviceInfoUtil pre-caching#5502

Draft
adinauer wants to merge 1 commit into
perf/sdk-overhead-reductionfrom
perf/sdk-overhead-reduction-reuse-executor
Draft

perf(android): [SDK Overhead Reduction 3] Reuse SentryExecutorService for DeviceInfoUtil pre-caching#5502
adinauer wants to merge 1 commit into
perf/sdk-overhead-reductionfrom
perf/sdk-overhead-reduction-reuse-executor

Conversation

@adinauer
Copy link
Copy Markdown
Member

@adinauer adinauer commented Jun 5, 2026

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

…hing

Replace Executors.newSingleThreadExecutor() with
options.getExecutorService() in DefaultAndroidEventProcessor to avoid
creating a dedicated thread during init. The SDK already has an executor
service available.
@sentry
Copy link
Copy Markdown

sentry Bot commented Jun 5, 2026

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.43.1 (1) release

⚙️ sentry-android Build Distribution Settings

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.

1 participant