Skip to content

[scheduler] Memoize the time grid columns, so the grid's own updates don't re-render every event - #24179

Draft
Janpot wants to merge 1 commit into
mui:masterfrom
Janpot:janpot/scheduler-memo-time-grid-columns
Draft

Janpot wants to merge 1 commit into
mui:masterfrom
Janpot:janpot/scheduler-memo-time-grid-columns

Conversation

@Janpot

@Janpot Janpot commented Nov 12, 2026

Copy link
Copy Markdown
Member

Right after mount, DayTimeGrid sets hasScroll from a layout effect, which re-renders the grid. Its TimeGridColumns weren't memoized, so that second commit re-rendered every event of every column. Their props are primitives and a memoized day, so React.memo skips them.

Measured with the smoke benchmark of #24028 (EventCalendar week view with 200 events, 30 rounds, 99% intervals): render −27% to −32%, bench:paint −18% to −25%; the post-mount update went from 17.4 ms to 1.4 ms. I'll rebase onto #24028 once it's merged, so the benchmark comment shows it.

@code-infra-dashboard

Copy link
Copy Markdown

Deploy preview

https://deploy-preview-24179--material-ui-x.netlify.app/
QR code for https://deploy-preview-24179--material-ui-x.netlify.app/

Bundle size

Bundle Parsed size Gzip size
@mui/x-data-grid 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-pro 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-premium 0B(0.00%) 0B(0.00%)
@mui/x-charts 0B(0.00%) 0B(0.00%)
@mui/x-charts-pro 0B(0.00%) 0B(0.00%)
@mui/x-charts-premium 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers-pro 0B(0.00%) 0B(0.00%)
@mui/x-tree-view 0B(0.00%) 0B(0.00%)
@mui/x-tree-view-pro 0B(0.00%) 0B(0.00%)
@mui/x-scheduler 🔺+9B(0.00%) ▼-1B(0.00%)
@mui/x-scheduler-premium 🔺+9B(0.00%) 0B(0.00%)
@mui/x-chat 0B(0.00%) 0B(0.00%)
@mui/x-license 0B(0.00%) 0B(0.00%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

@Janpot Janpot added performance type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature. scope: scheduler Changes related to the scheduler. labels Nov 12, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance scope: scheduler Changes related to the scheduler. type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant