You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e279b06
Browse filesBrowse the repository at this point in the historyBrowse files
perf(android): Avoid exception-driven control flow in getResourceId (#5631)
* perf(android): Avoid exception-driven control flow in getResourceId
ViewUtils.getResourceId threw Resources.NotFoundException for views with
no id or a generated id, and callers caught and discarded it. During a
view-hierarchy snapshot and on every gesture this ran per view, so in
Compose-heavy apps where most views have generated ids the SDK
constructed an exception (and a native stack trace fill) per view on the
main thread.
Add a non-throwing resolveResourceId that returns null for unresolved
ids and route the hot callers through it. The public getResourceId
remains as a throwing wrapper for backward compatibility. Behavior
(emitted identifiers and fallbacks) is unchanged.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* changelog
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,7 @@
14
14
15
15
- Speed up touch gesture target detection on deeply nested view hierarchies by hit-testing in local coordinates instead of calling `getLocationOnScreen` per view ([#5595](https://github.com/getsentry/sentry-java/pull/5595))
16
16
- Probe class availability without initializing the class during SDK init ([#5635](https://github.com/getsentry/sentry-java/pull/5635))
17
+
- Avoid constructing an exception per view when resolving view ids during view-hierarchy and gesture capture ([#5631](https://github.com/getsentry/sentry-java/pull/5631))
Copy file name to clipboardExpand all lines: sentry-android-core/src/main/java/io/sentry/android/core/internal/gestures/AndroidViewGestureTargetLocator.java
0 commit comments