mui-x icon indicating copy to clipboard operation
mui-x copied to clipboard

[DataGrid] All cells are all rerendered on every keystroke when row is in edit mode

Open michaelperrin opened this issue 2 years ago • 4 comments

Steps to reproduce

Link to live example: https://codesandbox.io/s/456w8t?file=/Demo.js

Steps:

  1. Set up a DataGrid with multiple rows and editable columns
  2. Open the React DevTools and enable the Highlight updates when components render option (or use the Profiler).
  3. Double click on a cell to enter edit mode
  4. Type some text

Current behavior

On every keystroke, all cells are shown as re-rendered.

Expected behavior

Expected result: only the edited cell should be re-rendered.

Context

A datagrid with a large number of rows and columns can become very sluggish to edit for the enduser.

Your environment

npx @mui/envinfo
Tested on latest versions of Chrome and Firefox.

System:
    OS: macOS 13.5.2
  Binaries:
    Node: 18.17.1 - /usr/local/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 9.6.7 - /usr/local/bin/npm
  Browsers:
    Chrome: 117.0.5938.149
    Edge: Not Found
    Safari: 16.6
  npmPackages:
    @emotion/react: latest => 11.11.1 
    @emotion/styled: latest => 11.11.0 
    @mui/base:  5.0.0-beta.19 
    @mui/core-downloads-tracker:  5.14.13 
    @mui/material: latest => 5.14.13 
    @mui/private-theming:  5.14.13 
    @mui/styled-engine:  5.14.13 
    @mui/system:  5.14.13 
    @mui/types:  7.2.6 
    @mui/utils:  5.14.13 
    @mui/x-data-grid: latest => 6.16.1 
    @types/react:  18.2.28 
    react: latest => 18.2.0 
    react-dom: latest => 18.2.0 
    typescript:  5.2.2 

Search keywords: datagrid cell rerendered Order ID: 63752

michaelperrin avatar Oct 11 '23 12:10 michaelperrin

No feedback or progress so far?

HJK181 avatar Mar 12 '24 09:03 HJK181

I'm facing the same Issue. No oficial response of MUI about this???

ezequielgalardi avatar May 14 '24 19:05 ezequielgalardi

Hi, Sorry for the late reply, we have missed this issue somehow.

A datagrid with a large number of rows and columns can become very sluggish to edit for the enduser.

Note that both rows and columns are virtualized, so only the visible cells (+ some buffer cells) are rendered. Can you provide an example where we can reproduce the slugginess?

Expected result: only the edited cell should be re-rendered.

I'm not sure it is the expected result. In the "row" edit mode, you might have linked fields.

cherniavskii avatar May 16 '24 12:05 cherniavskii

I feel like this is a real issue and we can improve the performance, but it would help us prioritize it if we can have an example use-case where we can see it being slow.

romgrk avatar May 17 '24 14:05 romgrk

The issue has been inactive for 7 days and has been automatically closed.

github-actions[bot] avatar May 23 '24 15:05 github-actions[bot]

Just for information, I will try to see if I can reproduce again the issue next week. If I find a use-case, I will re-open this issue or create a new one.

michaelperrin avatar May 23 '24 15:05 michaelperrin