perf(core): [SDK Overhead Reduction 1] Skip java.specification.version lookup on Android#5500
Draft
adinauer wants to merge 1 commit into
Draft
Conversation
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.
📲 Install BuildsAndroid
|
Contributor
Performance metrics 🚀
|
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

PR Stack (SDK Overhead Reduction)
📜 Description
In the
Platform.javastatic initializer, when running on Android, skip theSystem.getProperty("java.specification.version")lookup andDouble.valueOfparse, directly settingisJavaNinePlus = 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📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
More SDK overhead reduction PRs in this stack.
#skip-changelog