Skip to content

plan: Add component memoization implementation plan#1296

Draft
mofojed wants to merge 1 commit intodeephaven:mainfrom
mofojed:ui-component-memoization
Draft

plan: Add component memoization implementation plan#1296
mofojed wants to merge 1 commit intodeephaven:mainfrom
mofojed:ui-component-memoization

Conversation

@mofojed
Copy link
Member

@mofojed mofojed commented Feb 6, 2026

Two options for props-based memoization to skip re-renders:
- Option A: @ui.memo decorator (familiar to React devs)
- Option B: @ui.component(memo=True|compare_fn) parameter (cleaner)

Includes:
- API design and implementation details
- MemoizedFunctionElement and Renderer changes
- Unit tests for both options
- Performance benchmarks
- Comparison and recommendation (implement both)

@mofojed mofojed requested a review from mattrunyon February 6, 2026 15:11
@mofojed mofojed self-assigned this Feb 6, 2026
@github-actions
Copy link

github-actions bot commented Feb 6, 2026

Pull Request titles must follow the Conventional Commits specification.

Details:

Unknown release type "plan" found in pull request title "plan: Add component memoization implementation plan". 

Available types:
 - feat: A new feature
 - fix: A bug fix
 - docs: Documentation only changes
 - style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
 - refactor: A code change that neither fixes a bug nor adds a feature
 - perf: A code change that improves performance
 - test: Adding missing tests or correcting existing tests
 - build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
 - ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
 - chore: Other changes that don't modify src or test files
 - revert: Reverts a previous commit

Two options for props-based memoization to skip re-renders:
- Option A: @ui.memo decorator (familiar to React devs)
- Option B: @ui.component(memo=True|compare_fn) parameter (cleaner)

Includes:
- API design and implementation details
- MemoizedFunctionElement and Renderer changes
- Unit tests for both options
- Performance benchmarks
- Comparison and recommendation (implement both)
@mofojed mofojed force-pushed the ui-component-memoization branch from f383c9d to e85f1bc Compare February 6, 2026 15:13
)
```

---
Copy link
Member Author

Choose a reason for hiding this comment

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

With this notation we could also write:

memo_parent = ui.memo(parent)

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.

1 participant