-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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 issue: data table with pagination #6883
Comments
Can you include some performance metrics that you used to see that this is slowing down the table? |
The browser recreates the dom instead of reusing it. |
That article describes how This is the same logic we use in the table. The table reuses practically the exact code and underlying However, it sounds like you want us to reuse the row template between two different sets of data. This is different than what
Note that since Finally, since we'll be adding in a Given the cost of these things, we really need performance metrics that help us understand how the table is slow before we begin to make such changes. We are striving to make the table as performant as possible while providing a capable set of features. If you find an optimal set of logic that we can use, we are all ears, but we do really need some metrics that helps back up the changes. |
My knowledge is obviously weak but, to render a table with pagination & sorting, I would use one array to store all the rows and an other one to store the rows to render. What are you thoughts on this? |
What you're suggesting would add a lot of overhead and memory to the table, as well as couple the table to the concepts of sorting and pagination. This would likely harm the table's performance rather than improve it, and make it much less flexible for broad generic usage. You're welcome to clone the repo and test any changes you are proposing. If you find something that works more efficiently, feel free to send us a PR. |
After investigation on a data-table with pagination which I created last year, as long as you don't use complex components in your table, the render time are similar. Though, if you added some performance heavy components to the rows such as an md-button, the md-table will be much slower than table which would reuse the DOM. |
Hi. Is it possible to create two different data tables with pagination in one Component? I tried to read the documentation, but I did not find anything. |
@SpEcHiDe Shouldn't be a problem, just use template reference strings to grab the paginator, e.g. Template: <mat-paginator #mySecondPaginator> Component TS: @ViewChild('mySecondPaginator') mySecondPaginator: MatPaginator; Here's a plunker as an example of two tables with separate paginators: https://plnkr.co/edit/GfRj8bxsRjauoqxJil8C?p=preview |
Hi I'm litle bit stuck because I want to assign multiple paginator on multiple datatable generated... How can I perform that ? I can actually generate multiple datatable but not appliying the pagination on each one. This is how my datatable are generated (mat-paginator is not working):
Thank you! |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug, feature request, or proposal:
Bug
What is the expected behavior?
Data Table should not recreate the rows when going to the next page.
What is the current behavior?
Data Table should reuse the rows when going to the next page.
What are the steps to reproduce?
https://material.angular.io/components/table/overview#pagination
What is the use-case or motivation for changing an existing behavior?
Angular Material has several performance issues which I think should be addressed.
The web is already slow, no need to make it any slower.
Consider using
trackBy
feature.Which versions of Angular, Material, OS, TypeScript, browsers are affected?
@angular/material: ^2.0.0-beta.10
The text was updated successfully, but these errors were encountered: