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

Grid: selectively rerun track sizing #341

Merged

Conversation

nicoburns
Copy link
Collaborator

@nicoburns nicoburns commented Jan 29, 2023

Objective

Improve performance of the CSS Grid algorithm. This one was the last one on my list of obvious optimisations.

Improvements

These changes seem to provide modest but consistent improvements (~10%) for our existing benchmark. It also leads to more significant improvements (~50%) for the case where:

  • The container size is known
  • All columns are either a fixed (absolute or percentage) size or minmax(0, 1fr)

The 6500 node "deep" benchmark is down to ~8ms with this PR and with all minmax(0, 1fr) (and ~18ms with a random mix of track types). This is quite a common use case "I want N evenly sized row or columns", so this represents quite a useful fast path.

@nicoburns nicoburns mentioned this pull request Jan 29, 2023
87 tasks
@nicoburns nicoburns force-pushed the grid/selectively-rerun-track-sizing branch from 496c1a8 to b8507c2 Compare January 29, 2023 17:32
@nicoburns nicoburns merged commit 08c16a7 into DioxusLabs:main Jan 29, 2023
@nicoburns nicoburns deleted the grid/selectively-rerun-track-sizing branch January 29, 2023 17:49
@nicoburns nicoburns added this to the 0.3 "CSS Grid" milestone Jan 29, 2023
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