Skip to content

Add layout_modes benchmark and refactor layout.rs for optimization - #45

Open
geom3trik wants to merge 2 commits into
mainfrom
performance
Open

geom3trik wants to merge 2 commits into
mainfrom
performance

Conversation

@geom3trik

Copy link
Copy Markdown
Collaborator

No description provided.

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread src/node.rs
store: &Self::Store,
sublayout: &mut Self::SubLayout<'_>,
) {
self.invalidate_layout_cache(cache, tree);
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