Skip to content

perf: skip redundant rebuilds in inherited element updates#48

Open
nielsenko wants to merge 1 commit intoNorbert515:mainfrom
nielsenko:perf-avoid-redundant-rebuilds
Open

perf: skip redundant rebuilds in inherited element updates#48
nielsenko wants to merge 1 commit intoNorbert515:mainfrom
nielsenko:perf-avoid-redundant-rebuilds

Conversation

@nielsenko
Copy link
Contributor

@nielsenko nielsenko commented Feb 10, 2026

  • Replaced the unconditional rebuild() with updateChild(). This allows the framework to synchronize the child element rather than marking the entire branch as dirty.
  • Added identical(component, newComponent) checks in update on StatelessElement and StatefulElement. If the component instance has not changed, the update now short-circuits immediately, preventing unnecessary build passes.
  • Added a test to illustrate the problem is fixed.

This fixes #43

- Add early return in State(less/full)Element.update when component is identical.
- Fix InheritedElement.update to use updateChild instead of rebuild.
@nielsenko nielsenko force-pushed the perf-avoid-redundant-rebuilds branch from c2da71a to 8568400 Compare February 13, 2026 09:26
@nielsenko
Copy link
Contributor Author

Rebased on 0.5.1

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.

Unexpected behaviour for InheritedElement.update

1 participant

Comments