Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Page hangs due to performance issue when carbon datatable mounts the row nodes that count is lager than 40,000 #6147

Closed
fly-fan opened this issue May 27, 2020 · 0 comments

Comments

@fly-fan
Copy link

fly-fan commented May 27, 2020

I use the 2 embedded carbon10 datatable (https://react.carbondesignsystem.com/?path=/story/datatable--with-batch-expansion) to build a tree datatable to mount a large of row node(the count is larger than 40,000), the page is hang due to performance issue.
My usage for carbon datatable in my code is as follows:

    **<DataTable**  //the first level datatable 
      rows={level1rows}
      headers={level1headers}
      render={({ rows, headers, getRowProps, getTableProps }) => (
        <TableContainer>
          <Table {...getTableProps()}>
            <TableBody>
              {rows.map(row => (
                <React.Fragment key={row.id}>
                  <TableExpandRow {...getRowProps({ row })}>
                    {row.cells.map(cell => (
                      <TableCell key={cell.id}>
                        {cell.info.header === 'checkbox' && (
                          <Checkbox
                            id={row.id}
                            indeterminate={isRowIndeterminate(row.id)}
                            onChange={onRowClick(row.id)}
                            checked={todoClick(row.id)}
                          />
                        )}
                        {cell.value}
                      </TableCell>
                    ))}
                  </TableExpandRow>
                  {row.isExpanded && (
                    <TableExpandedRow colSpan={headers.length + 1}>
                         **<DataTable**   //the 2nd level datatable
                              rows={level2rows}
                              headers={level2headers}
                              render={({ rows, headers, getRowProps, getTableProps }) => (
                                 <TableContainer>
                                    <Table {...getTableProps()}>
                                        <TableBody>
                                              {rows.map(row => (
                                                      <React.Fragment key={row.id}>
                                                             <TableRow {...getRowProps({ row })}>
                                                                  {row.cells.map(cell => (
                                                                     <TableCell key={cell.id}>
                                                                           {cell.info.header === 'checkbox' && (
                                                                                    <Checkbox
                                                                                       id={level2rowid}
                                                                                       indeterminate={false}
                                                                                        onChange={todoClick(checked)}
                                                                                         defaultCheck
                                                                                     />
                                                                          )}
                                                                                    {cell.value}
                                                                     </TableCell>
                                                                    ))}
                                                             </TableRow>
                                                       </React.Fragment>
                                                      ))}
                                           </TableBody>
                                    </Table>
                          </TableContainer>
                           )}
                          />
                    </TableExpandedRow>
                  )}
                </React.Fragment>
              ))}
            </TableBody>
          </Table>
        </TableContainer>
      )}
    />

The 'level1rows' has just one row, but the second level 'level2rows' has the more than 40,000 rows, and the first column in both level are checkbox.
When mount and render these 40,000 row nodes in my page, the page hangs due to performance for so many row nodes mount and render.

@fly-fan fly-fan changed the title Page hangs due to performance issue when carbon table mounts the row nodes that count is lager than 40,000 Page hangs due to performance issue when carbon datatable mounts the row nodes that count is lager than 40,000 May 27, 2020
@alisonjoseph alisonjoseph mentioned this issue Jun 1, 2020
41 tasks
@sstrubberg sstrubberg closed this as not planned Won't fix, can't repro, duplicate, stale Dec 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

3 participants