-
Notifications
You must be signed in to change notification settings - Fork 71
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
Conversation
@@ -11,7 +11,7 @@ | |||
<key>com.apple.XCTPerformanceMetric_WallClockTime</key> | |||
<dict> | |||
<key>baselineAverage</key> | |||
<real>17.200000</real> | |||
<real>5.930000</real> |
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.
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.
Setting both to 2
brings it down to 1.961 sec.
Setting both to 4
brings it down to 1.074 sec.
a5f632b
to
f1b9f92
Compare
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.
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 { |
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.
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.
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.
Vertical scroll indicator might be a good example of where this could fail right now
No description provided.