-
-
Notifications
You must be signed in to change notification settings - Fork 428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SR] Redaction fixes part 1 #3466
[SR] Redaction fixes part 1 #3466
Conversation
Performance metrics 🚀
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
if (node.shouldRedact && (node.width > 0 && node.height > 0)) { | ||
node.visibleRect ?: return@traverse false | ||
|
||
if (viewHierarchy.isObscured(node)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since you need to traverse every node here, this is a n^2 operation. Not saying that this is bad, but we should probably profile this at some point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, for sure. I don't think there's any other way though, at least not from the top of my head. I've tried to optimize it with DFS and skipping traversal of irrelevant nodes/subtrees, so n^2 is really the worst case here, and probably will never happen, because the likelihood of all the nodes' visible rects intersecting is very small
!otherNode.isImportantForContentCapture || | ||
!otherNode.visibleRect.contains(node.visibleRect) | ||
) { | ||
return@traverse false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice optimization!
#skip-changelog
📜 Description
Multiple improvements to redaction logic:
Some screenshots before/after (notice on the 1st sscreesnhot there are white rectangles drawn on top of the bottom navigation bar, now this is fixed):
💡 Motivation and Context
Part of getsentry/sentry#70065