Skip to content

perf(core): [SDK Overhead Reduction 1] Skip java.specification.version lookup on Android#5500

Draft
adinauer wants to merge 1 commit into
perf/sdk-overhead-reductionfrom
perf/sdk-overhead-reduction-platform-android-skip
Draft

perf(core): [SDK Overhead Reduction 1] Skip java.specification.version lookup on Android#5500
adinauer wants to merge 1 commit into
perf/sdk-overhead-reductionfrom
perf/sdk-overhead-reduction-platform-android-skip

Conversation

@adinauer
Copy link
Copy Markdown
Member

@adinauer adinauer commented Jun 5, 2026

PR Stack (SDK Overhead Reduction)


📜 Description

In the Platform.java static initializer, when running on Android, skip the System.getProperty("java.specification.version") lookup and Double.valueOf parse, directly setting isJavaNinePlus = false. Android is never Java 9+, so this work is unnecessary on the Android cold-start path.

The JVM code path is unchanged.

💡 Motivation and Context

Part of a series of SDK overhead reduction changes identified through automated Perfetto trace benchmarking. While this individual change is below the noise floor in isolation (~0.6% improvement), it removes unnecessary work from the Android startup critical path and is a clean, risk-free optimization.

💚 How did you test it?

  • ./gradlew :sentry:test — all tests pass
  • ./gradlew spotlessApply apiDump — no API surface changes
  • Benchmarked via Perfetto traces (AR-72 in autoresearch report)

📝 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

Android is never Java 9+, so the System.getProperty +
Double.valueOf parse in the Platform static initializer is
unnecessary overhead on the Android cold-start path.
Short-circuit to isJavaNinePlus=false when isAndroid is true.
@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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 5, 2026

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 318.53 ms 359.14 ms 40.61 ms
Size 0 B 0 B 0 B

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