Conversation
Add a new `layout_modes` benchmark covering stack, wrap, overlay, grid, and incremental layout scenarios. Refactor `layout.rs` to cache repeated calls to `node.direction()` and `node.main_between()`, and simplify alignment fraction computation by extracting `alignment_fractions` helper instead of a match expression with manual axis swapping.
There was a problem hiding this comment.
Pull request overview
Adds layout benchmarks and subtree caching to reduce repeated layout work.
Changes:
- Adds cached layout reuse and invalidation.
- Avoids duplicate wrapped-child layout.
- Adds regression tests and Criterion benchmarks.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/cache.rs |
Defines cached layout APIs. |
src/node.rs |
Invalidates dirty layout paths. |
src/layout.rs |
Reuses cached results and optimizes layout. |
ecs/src/implementations.rs |
Implements ECS layout caching. |
tests/incremental.rs |
Tests sibling subtree reuse. |
tests/wrap.rs |
Tests duplicate-layout avoidance. |
benches/layout_modes.rs |
Benchmarks layout modes. |
Cargo.toml |
Registers benchmarks. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| store: &Self::Store, | ||
| sublayout: &mut Self::SubLayout<'_>, | ||
| ) { | ||
| self.invalidate_layout_cache(cache, tree); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.