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

Performance (datatable): limiting re-render for only radiobutton/checkbox cells at row selection #7425

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

acc-cassio
Copy link

@acc-cassio acc-cassio commented Nov 16, 2024

Defect Fixes

Fix #2979.

Main change was the split of the BodyCell into two separate components: one for the Radio buttons and Checkboxes, and another for the rest of the cells. In this way, it is now possible to define different dependencies for them in React.memo, which create a performance gain when selecting row -> only the radio buttons/checkboxes cells are now re-rendered.
This is quite significant mainly when making a "select all rows" operation with a large dataset.

Also some smaller performance improvements by taking out parameters and functions of the BodyCells and placing in the BodyRow and wrapping them in useCallback.

There is still room for performance improvements in future contributions by implementing priority loading and meaningful prop comparison for BodyRow component. Sorting/Filtering operations are still quite inneficient and should also be worked on in the future (will try to do it in the next weeks/months).

Copy link

vercel bot commented Nov 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Updated (UTC)
primereact ⬜️ Ignored (Inspect) Visit Preview Nov 18, 2024 10:22pm
primereact-v9 ⬜️ Ignored (Inspect) Visit Preview Nov 18, 2024 10:22pm

@acc-cassio acc-cassio changed the title Dtable performance rowandcell Performance (datatable): limiting re-render for only radiobutton/checkbox cells at row selection Nov 17, 2024
@melloware melloware added the Type: Performance Issue is performance or optimization related label Nov 17, 2024
@melloware melloware added the Status: Pending Review Issue or pull request is being reviewed by Core Team label Nov 17, 2024
@melloware
Copy link
Member

another good one! I assigned PrimeTek to review

…ns of BodyCell.js from usecallback - they would get re-created anyway since they depend on functions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Pending Review Issue or pull request is being reviewed by Core Team Type: Performance Issue is performance or optimization related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DataTable: seems to re-render all the rows on select all, even with the pagination.
3 participants