Skip to content

add MUI X#1171

Open
oliviertassinari wants to merge 1 commit into
TanStack:mainfrom
oliviertassinari:mui-x
Open

add MUI X#1171
oliviertassinari wants to merge 1 commit into
TanStack:mainfrom
oliviertassinari:mui-x

Conversation

@oliviertassinari
Copy link
Copy Markdown

@oliviertassinari oliviertassinari commented May 23, 2026

Result:

Mount time — React.render → commit (lower is better, ms)

Scenario tanstack virtua virtuoso window mui-x
mount-fixed-1k 0.6 0.3 0.9 0.8 1.1
mount-fixed-10k 1.4 0.6 1.2 1.1 2.2
mount-fixed-100k 4.4 2.6 3.1 2.8 13.7
mount-dynamic-1k 1.4 1.1 1.7 1.5 1.9
mount-dynamic-10k 4.9 6.3 7.1 5.2 8.9

Dynamic measurement — commit → stable total size (lower is better, ms)

Scenario tanstack virtua virtuoso window mui-x
mount-dynamic-1k 128.0 126.0 193.4 128.5 143.8
mount-dynamic-10k 126.1 120.1 201.0 123.0 166.8

First paint (lower is better, ms)

Scenario tanstack virtua virtuoso window mui-x
mount-fixed-1k 8.1 7.6 4.9 3.0 8.4
mount-fixed-10k 7.7 4.8 8.3 8.6 8.1
mount-fixed-100k 8.7 9.2 9.1 9.7 20.9

Scroll perf — fps (higher is better)

Scenario tanstack virtua virtuoso window mui-x
scroll-to-bottom-10k 60.0 60.0 60.0 60.0 60.0
fast-scroll-dynamic-10k 60.0 60.0 60.0 60.0 60.0

Scroll jank — long frames count (lower is better)

Scenario tanstack virtua virtuoso window mui-x
scroll-to-bottom-10k 0.0 0.0 0.0 0.0 0.0
fast-scroll-dynamic-10k 0.0 0.0 0.0 0.0 0.0

Jump-to-end settle time (lower is better, ms)

Scenario tanstack virtua virtuoso window mui-x
jump-to-end-dynamic-10k 92.3 75.3 168.5 75.1 74.9

scrollToIndex landing accuracy — px offset from target (lower is better)

Scenario tanstack virtua virtuoso window mui-x
jump-to-middle-accuracy-dynamic-10k 0.0 -1.0 0.0 135.0 0.0
jump-to-last-accuracy-dynamic-10k 0.0 -1.0 0.0 224.0 -1.0
jump-while-measuring-accuracy-dynamic-10k 0.0 -1.0 0.0 135.0 0.0
jump-wide-variance-accuracy-10k 0.0 -1.0 0.0 171.0 836.0

Memory after mount (lower is better, MB)

Scenario tanstack virtua virtuoso window mui-x
mount-fixed-10k 3.6 5.5 5.8 5.9 7.1
mount-fixed-100k 10.8 9.7 9.9 10.0 18.3
mount-dynamic-10k 5.1 6.9 7.5 7.4 8.9

Summary by CodeRabbit

  • New Features

    • Added MUI X Virtualizer to the library comparison benchmarks
    • Users can now benchmark MUI X Virtualizer against TanStack, Virtua, Virtuoso, and Window implementations
  • Documentation

    • Updated benchmark README with notes on how MUI X's grid-oriented virtualizer is adapted for single-column lists

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 23, 2026

📝 Walkthrough

Walkthrough

This PR adds @mui/x-virtualizer as a fifth benchmarked library in the benchmark suite. Changes include type updates, a new npm dependency, runner configuration, app routing, a 205-line MUI page component that adapts MUI X's grid virtualizer to list rendering with harness integration, and documentation of the adaptation approach.

Changes

MUI X Virtualizer Benchmark Integration

Layer / File(s) Summary
Type definition, dependency, and runner setup
benchmarks/src/scenarios/types.ts, benchmarks/package.json, benchmarks/runner/run.mjs
LibraryName type union adds 'mui-x' literal, @mui/x-virtualizer@^9.0.0-alpha.7 is added to dependencies, and mui-x is registered in ALL_LIBS for default benchmark inclusion.
App integration and library routing
benchmarks/src/main.tsx
MuiPageRoot is imported and a new mui-x case is added to the library selector switch, delegating to the MUI page component for the selected scenario.
MUI X benchmark page implementation
benchmarks/src/pages/MuiPage.tsx
Introduces MuiPage and MuiPageRoot components that wrap MUI X's LayoutList/useVirtualizer: adapts the grid-oriented virtualizer to single-column rendering, integrates with the benchmark harness (scroll container, scrollToIndex, height reporting), provides React contexts for virtualizer access and dynamic row height observation, splits rendering into MuiListContent rows and memoized MuiRow components with optional height measurement callbacks, and marks mount timing via MuiPageRoot.
Benchmark documentation and fairness notes
benchmarks/README.md
README intro list is updated to include @mui/x-virtualizer, and a new fairness caveat section explains the grid-to-list adaptation using LayoutList with a single-column placeholder and dynamic row height measurement via getRowHeight and observeRowHeight.

🎯 3 (Moderate) | ⏱️ ~20 minutes

🐰 Five libs now hop in your benchmark race,
MUI X joins the grid-to-list embrace,
With heights observed and rows aligned,
A fair comparison well-designed!

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (2 warnings, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description contains only benchmark results tables and completely omits all required sections: motivation, changes explanation, checklist items, and release impact declaration. Complete the description template by adding 'Changes' section explaining the MUI X integration, checking required boxes, and declaring release/docs-only impact.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title is vague and non-descriptive, using only 'add MUI X' without clarifying what aspect of the project was changed or why. Use a more descriptive title that explains the scope, such as 'Add MUI X virtualizer to benchmarks' or 'Add MUI X comparison in benchmark suite'.
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@socket-security
Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​mui/​x-virtualizer@​9.0.0-alpha.79810074100100

View full report

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@benchmarks/README.md`:
- Line 3: The README's intro claims five libraries but the "Latest results" and
"Bottom line" sections still present four-library output; update the "Latest
results" and "Bottom line" sections to either regenerate and include the new
fifth-library benchmark data (ensuring tables/plots and summary include
`@tanstack/react-virtual`, virtua, react-virtuoso, react-window v2, and
`@mui/x-virtualizer`) or explicitly label those sections as "four-library results
(pre-update)" if you cannot regenerate; ensure headings "Latest results" and
"Bottom line" and any result tables/legends reflect the chosen option so the
document is not misleading.

In `@benchmarks/src/pages/MuiPage.tsx`:
- Around line 3-15: Split value and type imports and reorder groups to satisfy
ESLint: import runtime symbols (LayoutList, useVirtualizer) together from
'`@mui/x-virtualizer`' and import values from local modules (markFirstPaint,
markMountEnd, markMountStart, registerHarness, makeDataset) in their own group,
then use "import type" for purely type imports (Virtualizer, Item,
ScenarioInput) as separate statements; ensure external package imports come
before local imports and that each "import type" only contains type names (e.g.,
import type { Virtualizer } from '`@mui/x-virtualizer`'; import type { Item } from
'../lib/dataset'; import type { ScenarioInput } from '../scenarios/types').
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 989dba5d-4c97-4e6c-b854-3f90d7e26ce0

📥 Commits

Reviewing files that changed from the base of the PR and between 949180b and d621821.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (6)
  • benchmarks/README.md
  • benchmarks/package.json
  • benchmarks/runner/run.mjs
  • benchmarks/src/main.tsx
  • benchmarks/src/pages/MuiPage.tsx
  • benchmarks/src/scenarios/types.ts

Comment thread benchmarks/README.md
# Virtualization benchmarks

Reproducible browser benchmarks comparing **@tanstack/react-virtual**, **virtua**, **react-virtuoso**, and **react-window** v2.
Reproducible browser benchmarks comparing **@tanstack/react-virtual**, **virtua**, **react-virtuoso**, **react-window** v2, and **@mui/x-virtualizer**.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Keep result sections consistent with the new five-library claim.

The intro says five libraries, but the “Latest results”/“Bottom line” content still reads as four-library output. Please regenerate or clearly label those sections to avoid misleading comparisons.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@benchmarks/README.md` at line 3, The README's intro claims five libraries but
the "Latest results" and "Bottom line" sections still present four-library
output; update the "Latest results" and "Bottom line" sections to either
regenerate and include the new fifth-library benchmark data (ensuring
tables/plots and summary include `@tanstack/react-virtual`, virtua,
react-virtuoso, react-window v2, and `@mui/x-virtualizer`) or explicitly label
those sections as "four-library results (pre-update)" if you cannot regenerate;
ensure headings "Latest results" and "Bottom line" and any result tables/legends
reflect the chosen option so the document is not misleading.

Comment on lines +3 to +15
import {
LayoutList,
useVirtualizer,
type Virtualizer,
} from '@mui/x-virtualizer'
import {
markFirstPaint,
markMountEnd,
markMountStart,
registerHarness,
} from '../lib/harness'
import { makeDataset, type Item } from '../lib/dataset'
import type { ScenarioInput } from '../scenarios/types'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Fix import declarations to pass current ESLint checks.

This import block violates sort-imports and import/consistent-type-specifier-style; keep value imports and type imports separate to unblock lint.

Proposed fix
 import * as React from 'react'
 import { useEffect, useMemo, useRef } from 'react'
 import {
   LayoutList,
   useVirtualizer,
-  type Virtualizer,
 } from '`@mui/x-virtualizer`'
+import type { Virtualizer } from '`@mui/x-virtualizer`'
 import {
   markFirstPaint,
   markMountEnd,
   markMountStart,
   registerHarness,
 } from '../lib/harness'
-import { makeDataset, type Item } from '../lib/dataset'
+import { makeDataset } from '../lib/dataset'
+import type { Item } from '../lib/dataset'
 import type { ScenarioInput } from '../scenarios/types'
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import {
LayoutList,
useVirtualizer,
type Virtualizer,
} from '@mui/x-virtualizer'
import {
markFirstPaint,
markMountEnd,
markMountStart,
registerHarness,
} from '../lib/harness'
import { makeDataset, type Item } from '../lib/dataset'
import type { ScenarioInput } from '../scenarios/types'
import {
LayoutList,
useVirtualizer,
} from '`@mui/x-virtualizer`'
import type { Virtualizer } from '`@mui/x-virtualizer`'
import {
markFirstPaint,
markMountEnd,
markMountStart,
registerHarness,
} from '../lib/harness'
import { makeDataset } from '../lib/dataset'
import type { Item } from '../lib/dataset'
import type { ScenarioInput } from '../scenarios/types'
🧰 Tools
🪛 ESLint

[error] 6-6: Member 'Virtualizer' of the import declaration should be sorted alphabetically.

(sort-imports)


[error] 6-6: Prefer using a top-level type-only import instead of inline type specifiers.

(import/consistent-type-specifier-style)


[error] 14-14: Member 'Item' of the import declaration should be sorted alphabetically.

(sort-imports)


[error] 14-14: Prefer using a top-level type-only import instead of inline type specifiers.

(import/consistent-type-specifier-style)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@benchmarks/src/pages/MuiPage.tsx` around lines 3 - 15, Split value and type
imports and reorder groups to satisfy ESLint: import runtime symbols
(LayoutList, useVirtualizer) together from '`@mui/x-virtualizer`' and import
values from local modules (markFirstPaint, markMountEnd, markMountStart,
registerHarness, makeDataset) in their own group, then use "import type" for
purely type imports (Virtualizer, Item, ScenarioInput) as separate statements;
ensure external package imports come before local imports and that each "import
type" only contains type names (e.g., import type { Virtualizer } from
'`@mui/x-virtualizer`'; import type { Item } from '../lib/dataset'; import type {
ScenarioInput } from '../scenarios/types').

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