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

feat(web): gesture processing - path memory-use optimization 🐵 #10169

Merged
merged 6 commits into from
Dec 12, 2023

Conversation

jahorton
Copy link
Contributor

@jahorton jahorton commented Dec 7, 2023

The default mode for the gesture engine will no longer persistently store all coordinates visited by each touchpoint. All relevant data is accumulated within the CumulativePathStats object and can be obtained from there. This change thus should reduce runtime memory overhead, particularly for long-lived continuous gestures. (Intermediate coordinates may now be garbage-collected quite rapidly, even while their touchpoint lives on.)

Accordingly, a new configuration flag has been added: recordingMode. This flag reactivates persistent coordinate storing, which is useful for some of the existing automated tests and for, well, "recording" input sequences. It might also be of use when debugging gesture-related issues.

I'd always intended for this change to occur at some point... I'd just always "put off" finding the time to handle the few related loose ends. The biggest "loose end" was the handling of source "subview" generation as it relates to path inheritance when transitioning between gesture-model states. The other loose ends are all handled within the first commit.

@keymanapp-test-bot skip

@keymanapp-test-bot
Copy link

keymanapp-test-bot bot commented Dec 7, 2023

User Test Results

Test specification and instructions

User tests are not required

@keymanapp-test-bot keymanapp-test-bot bot changed the title feat(web): gesture processing - path memory-use optimization feat(web): gesture processing - path memory-use optimization 🐵 Dec 7, 2023
@keymanapp-test-bot keymanapp-test-bot bot added this to the A17S27 milestone Dec 7, 2023
@jahorton jahorton force-pushed the feat/web/gesture-path-memory-optimization branch from 06eeb96 to a8e7320 Compare December 8, 2023 04:52
@jahorton jahorton changed the base branch from change/web/path-evaluate-signature to feature-gestures December 8, 2023 04:52
@jahorton jahorton marked this pull request as ready for review December 8, 2023 04:54
@mcdurdin mcdurdin modified the milestones: A17S27, A17S28 Dec 8, 2023
Copy link
Contributor

@ermshiperete ermshiperete left a comment

Choose a reason for hiding this comment

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

LGTM

* Models the path over time through coordinate space taken by a touchpoint during
* its active lifetime.
*
* _Supported events_:
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see Event mentioned in this class and so I have a hard time understanding how the events described in the comment and GestureDebugPath connect

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, this started off by duplicating GesturePath.

Note that since GesturePath is the parent class, this class actually does provide those events as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

Should this file be renamed to gestureDebugPath.js ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The intent of these tests was always to validate GesturePath, the standard use-case variant. The tests involve assertions that can now only be fulfilled by the "Debug" variant.

If preferred, I could spend time doing a more "proper" split for the tests, but I figured that was comparatively low priority.

Copy link
Contributor

Choose a reason for hiding this comment

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

Should this file be renamed to gestureDebugSource.spec.ts ?

@jahorton jahorton merged commit ea0de27 into feature-gestures Dec 12, 2023
2 checks passed
@jahorton jahorton deleted the feat/web/gesture-path-memory-optimization branch December 12, 2023 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants