| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Sorry, something went wrong.
📲 Install BuildsAndroid
|
Sorry, something went wrong.
Performance metrics 🚀
Baseline results on branch: mainStartup times
App size
Previous results on branch: no/java-621-app-start-profiling-config-deserializationStartup times
App size
|
Sorry, something went wrong.
…r (JAVA-621) SentryPerformanceProvider.launchAppStartProfiler ran in ContentProvider.onCreate — main thread, before Application.onCreate, on every cold start — and built a full JsonSerializer(SentryOptions.empty()) to read one small config file. That path only ever reads options.getLogger(), but JsonSerializer's constructor registers every known deserializer to use exactly one of them. Calling the deserializer directly cuts the parse from 221 to 33 allocations and ~7.5us to ~3.7us (Pixel 10, androidx Microbenchmark, allocationCount is deterministic). Malformed input still yields null so callers keep reporting it as a deserialization failure rather than a read error. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…onfig Narrow the deserialization catch from Throwable to Exception. The vendored JSON reader signals bad input with IOException (MalformedJsonException, EOFException), IllegalStateException on token type mismatch, and NumberFormatException on an unparseable number — all Exception subclasses. Catching Throwable additionally swallowed Error, which is never a recoverable "config file is bad" signal. This also restores parity with JsonSerializer.deserialize, which catches Exception, so the replaced behaviour is matched exactly rather than widened. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Ftw!
Sorry, something went wrong.
There was a problem hiding this comment.
nice!
Sorry, something went wrong.
Drop the paragraph enumerating which exception types the vendored JSON reader throws. That catch (Exception) does not swallow Error is a language-level given, and listing the reader's internal exception types invites the comment to drift as that code changes. The rationale a reader cannot infer from the code — why the deserializer is called directly, and why null is returned instead of rethrowing — stays. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Instructions and example for changelogPlease add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number. Example: ## Unreleased
### Performance
- Parse app start profiling config without JsonSerializer ([#5867](https://github.com/getsentry/sentry-java/pull/5867))If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description or adding a skip-changelog label. |
Sorry, something went wrong.
The unreleased Performance entry for #5867 quoted specific allocation counts (188 of 221). Simplify it to state the benefit — fewer main-thread allocations — without the implementation detail. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
| Back | FazBrowse Home | New Git URL |
📜 Description
JsonSerializer is a massive object with 60 serializers but we only need one of them in SentryPerformanceProvider. We can't re-use the one held in SentryOptions because the SentryPerformanceProvider content provider has a higher priority than the SentryInitProvider.
So instead we create a serializer with only the serializer we need for this specific purpose.
Measured on a Pixel 10 (API 37) with androidx Microbenchmark, release build:
allocationCount is deterministic, so the allocation figures are exact. The timings are steady-state (JIT-warmed, clocks unlocked), so they understate the real cold-start saving — warmup amortizes away the class loading and verification of all those deserializer classes, which the real one-shot path pays in full. No claim is made about measurable end-to-end startup improvement; ~3.9 µs is small against a ~1 s cold start. The point is main-thread work removed from before Application.onCreate.
💡 Motivation and Context
Perf improvement
Related: #5708 and #5709 were previously closed for the same "small allocation win, not worth the trade off" reason.
GH Issue: #5707
Linear: #5707
💚 How did you test it?
Unit tests
📝 Checklist
🔮 Next steps
createAndStartContinuousProfiler also calls SentryOptions.empty(), for TracesSampler. That one genuinely needs a mutable options object (setProfileSessionSampleRate) and only runs when a sampled continuous-profiling config exists, so it is deliberately left alone.