Skip to content
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

Improve hit test performance by optimizing X axis #178

Merged
merged 1 commit into from
Jan 19, 2024

Conversation

NickEntin
Copy link
Collaborator

No description provided.

@@ -11,7 +11,7 @@
<key>com.apple.XCTPerformanceMetric_WallClockTime</key>
<dict>
<key>baselineAverage</key>
<real>17.200000</real>
<real>5.930000</real>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting both the permissible missed width and height to 1 gives another 65% improvement over #177, leading to a total ~88% improvement over #119.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting both to 2 brings it down to 1.961 sec.

Setting both to 4 brings it down to 1.074 sec.

@NickEntin NickEntin force-pushed the entin/hit-test-snapshot-performance-2 branch from a5f632b to f1b9f92 Compare January 4, 2024 22:02
@NickEntin NickEntin marked this pull request as ready for review January 5, 2024 20:58
@NickEntin NickEntin requested a review from dnagler January 5, 2024 20:59
Copy link
Collaborator

@dnagler dnagler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thanks!

}
}

// Finish the scan line if necessary.
if let lastHit = lastHit, let lastHitView = lastHit.1 {
scanLine.append(((lastHit.0...bounds.maxX), lastHitView))
if lastHit.0 != bounds.maxX {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wait, this has a similar problem to the Y axis. This assumes the maxPermissibleMissedRegionWidth will get you very close to the edge of the bounds, but if the width isn't nicely divisible by the step size this might not be true. I think we need another stride here to finish off the pass.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vertical scroll indicator might be a good example of where this could fail right now

Base automatically changed from entin/hit-test-snapshot-performance to master January 19, 2024 00:58
@NickEntin NickEntin merged commit 00aa519 into master Jan 19, 2024
6 checks passed
@NickEntin NickEntin deleted the entin/hit-test-snapshot-performance-2 branch January 19, 2024 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants