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

Optimize opening dropdown #5688

Merged
merged 2 commits into from
Feb 18, 2023
Merged

Optimize opening dropdown #5688

merged 2 commits into from
Feb 18, 2023

Conversation

kazcw
Copy link
Contributor

@kazcw kazcw commented Feb 17, 2023

Pull Request Description

Text rendering accounts for most of the time spent opening a dropdown. The dropdown widget has been rendering its text twice: Once for the selected (bold) state of the text, and once for unselected. Deferring rendering of whichever version of each label is initially hidden halves the time for a dropdown to open.

Remove this eager rendering has the consequence that, when clicking on an item in a dropdown, 1-2 lines must be rendered to show the new selection state. I have not found the cost of this partial-redraw noticeable in my testing; it completes before we receive and react to the engine message that results from the graph change.

image
Before: 537.5ms to open the 6-item Join_Kind dropdown in Orders

image
After: 273.4ms to open the dropdown (50% improvement)

Important Notes

Checklist

Please include the following checklist in your PR:

  • The documentation has been updated if necessary.
  • All code conforms to the
    Scala,
    Java,
    and
    Rust
    style guides.
  • All code has been tested:
    • Unit tests have been written where possible.
    • If GUI codebase was changed: Enso GUI was tested when built using BOTH
      ./run ide build and ./run ide watch.

@kazcw kazcw added the -gui label Feb 17, 2023
@kazcw kazcw self-assigned this Feb 17, 2023
@kazcw kazcw linked an issue Feb 17, 2023 that may be closed by this pull request
@kazcw kazcw added the CI: No changelog needed Do not require a changelog entry for this PR. label Feb 17, 2023
Copy link
Member

@wdanilo wdanilo left a comment

Choose a reason for hiding this comment

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

That's amazing!

@kazcw kazcw merged commit 2acc61d into develop Feb 18, 2023
@kazcw kazcw deleted the wip/kw/optimize-dropdowns branch February 18, 2023 19:31
@Frizi Frizi mentioned this pull request Mar 10, 2023
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: No changelog needed Do not require a changelog entry for this PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optimize text rendering during dropdown grid view creation
2 participants