Skip to content

Grid: selectively rerun track sizing#341

Merged
nicoburns merged 8 commits intoDioxusLabs:mainfrom
nicoburns:grid/selectively-rerun-track-sizing
Jan 29, 2023
Merged

Grid: selectively rerun track sizing#341
nicoburns merged 8 commits intoDioxusLabs:mainfrom
nicoburns:grid/selectively-rerun-track-sizing

Conversation

@nicoburns
Copy link
Copy Markdown
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