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

Add optimization to get a11y next word #7789

Merged
1 commit merged into from
Sep 30, 2020
Merged

Conversation

carlos-zamora
Copy link
Member

@carlos-zamora carlos-zamora commented Sep 30, 2020

This performs a minor refactor on TextBuffer::MoveToNextWord that
relies more heavily on TextBuffer::GetWordEnd. Now, the logic is
simplified and looks more like MoveToPreviousWord.

This refactor required me to move the lastCharPos optimization down to
GetWordEnd. So word expansion gets this optimization for free now.

WPR Traces

The percentages below represent the weight that a function call had. The
test scenario included moving by word on the CMD welcome message until
the last word was reached. Inspect.exe was used to limit any additional
calls that are generally performed by a screen reader.

function current branch
UIA:Move 34.55% 29.52%

There is an improvement of about 5% in a release build of ConHost.

NOTE: UIA::Move already calls Expand after a move operation is
performed. I'm using this data to represent a performance improvement
across both functions.

Contributes to #5243

@carlos-zamora carlos-zamora added Area-Accessibility Issues related to accessibility Issue-Task It's a feature request, but it doesn't really need a major design. Product-Conhost For issues in the Console codebase labels Sep 30, 2020
@DHowett
Copy link
Member

DHowett commented Sep 30, 2020

Our tests have missed big issues before -- is there a way we can build trust in this?

@codeofdusk I know you tested the combination of #7770 and #7789 before; were there any concerns?

@ghost ghost closed this Sep 30, 2020
@carlos-zamora carlos-zamora reopened this Sep 30, 2020
@carlos-zamora carlos-zamora changed the base branch from dev/cazamor/a11y/move-by-word-bugfix to master September 30, 2020 18:30
@codeofdusk
Copy link
Contributor

Nope, works great!

@DHowett
Copy link
Member

DHowett commented Sep 30, 2020

I recall word navigation feeling very sluggish. If this is noticeably better (like: is it usable???), I can easily sell it 😄

@codeofdusk
Copy link
Contributor

is it usable???

Certainly better, although please look into #5243.

I can easily sell it

To whom?

@DHowett
Copy link
Member

DHowett commented Sep 30, 2020

To whom?

As we get later in the Windows development cycle, we transition from feature work to bug work. After we move to bugs only, we start having to justify the fixes and their risks so that we're not introducing unnecessary/unhelpful changes as we get closer to release. 😄

const auto bufferSize = GetSize();
// move to the beginning of the next word
// NOTE: _GetWordEnd...() returns the exclusive position of the "end of the word"
// This is also the inclusive start of the next word.
Copy link
Member

Choose a reason for hiding this comment

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

CLEVER.

Copy link
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

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

I'd love to know the answers to my questions, but this looks technically sound.

@carlos-zamora
Copy link
Member Author

@msftbot merge this in 5 minutes

@ghost ghost added the AutoMerge Marked for automatic merge by the bot when requirements are met label Sep 30, 2020
@ghost
Copy link

ghost commented Sep 30, 2020

Hello @carlos-zamora!

Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:

  • I won't merge this pull request until after the UTC date Wed, 30 Sep 2020 21:11:21 GMT, which is in 5 minutes

If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you".

@ghost ghost merged commit 386ae04 into master Sep 30, 2020
@ghost ghost deleted the dev/cazamor/a11y/next-word-opt branch September 30, 2020 21:11
@DHowett
Copy link
Member

DHowett commented Oct 14, 2020

This fix was just released as part of Windows in Insider Build 20236!

DHowett pushed a commit that referenced this pull request Oct 19, 2020
This performs a minor refactor on `TextBuffer::MoveToNextWord` that
relies more heavily on `TextBuffer::GetWordEnd`. Now, the logic is
simplified and looks more like `MoveToPreviousWord`.

This refactor required me to move the `lastCharPos` optimization down to
`GetWordEnd`. So word expansion gets this optimization for free now.

### WPR Traces
The percentages below represent the weight that a function call had. The
test scenario included moving by word on the CMD welcome message until
the last word was reached. Inspect.exe was used to limit any additional
calls that are generally performed by a screen reader.

| function   | current | branch |
| --         | --      | --     |
| `UIA:Move` | 34.55%  | 29.52% |

There is an improvement of about 5% in a release build of ConHost.

NOTE: `UIA::Move` already calls `Expand` after a move operation is
performed. I'm using this data to represent a performance improvement
across both functions.

Contributes to #5243

(cherry picked from commit 386ae04)
@ghost
Copy link

ghost commented Nov 11, 2020

🎉Windows Terminal v1.4.3141.0 has been released which incorporates this pull request.:tada:

Handy links:

@ghost
Copy link

ghost commented Nov 11, 2020

🎉Windows Terminal Preview v1.5.3142.0 has been released which incorporates this pull request.:tada:

Handy links:

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Accessibility Issues related to accessibility AutoMerge Marked for automatic merge by the bot when requirements are met Issue-Task It's a feature request, but it doesn't really need a major design. Product-Conhost For issues in the Console codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants