| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
FeedbackShakeIntegration.register() resolved the accelerometer via SensorManager synchronously on the calling thread, which under auto-init is the main thread. On a Pixel 10 this first SensorManager access measured ~1.75ms, making it the single most expensive integration in the Sentry.init register loop. Submit the pre-warm init() to the executor service instead. start() already re-runs the idempotent init() on demand, so shake detection still works if an activity resumes before the warm-up completes. SentryShakeDetector's lifecycle methods are now synchronized so the executor warm-up and a main-thread start() cannot race on the sensor fields. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
📲 Install BuildsAndroid
|
Sorry, something went wrong.
Performance metrics 🚀
Baseline results on branch: mainStartup times
App size
Previous results on branch: no/feedbackshake-register-asyncStartup times
App size
|
Sorry, something went wrong.
There was a problem hiding this comment.
I think the bot comment needs addressing but LGTM otherwise, pre-approving
Sorry, something went wrong.
…618) A warm-up init submitted to the executor could be drained after the integration's close() ran, since integrations shut down before the executor. That re-resolved the sensor and leaked a HandlerThread. Guard init()/start() with a closed latch so a late warm-up is a no-op. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 6b4dae5. Configure here.
Sorry, something went wrong.
The closed latch added to neutralize a warm-up drained after close() was permanent, so re-registering the same integration (e.g. a second Sentry.init reusing the same options) left shake detection off with no recovery. register() now re-arms the detector via reopen(), which the stale-warm-up path (init()) deliberately does not, preserving the drain-after-close guard. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
| Back | FazBrowse Home | New Git URL |
Summary
FeedbackShakeIntegration.register() resolved the accelerometer via SensorManager synchronously on the calling thread — the main thread under auto-init. On a Pixel 10 (Android 17, release build) this first SensorManager access measured ~1.75 ms, making it the single most expensive integration in the Sentry.init register loop (the loop total was ~5.1 ms).
This moves the pre-warm shakeDetector.init(...) onto options.getExecutorService(). SentryShakeDetector.start() already re-runs the idempotent init() on demand, so shake detection still works if an activity resumes before the warm-up finishes. SentryShakeDetector's lifecycle methods (init/start/stop/close) are now synchronized so the executor warm-up and a main-thread start() cannot race on the sensor fields.
Measurement (Pixel 10, release, median of 10 cold starts)
Follow-up to JAVA-618. Companion PR defers the other big synchronous item (NDK init).