GwtMaterialDesign / gwt-material-table

A complex table component designed for the material design specifications
https://gwtmaterialdesign.github.io/gmd-table-demo/
Apache License 2.0
27 stars 31 forks source link

Really bad performance with tables with large number of pages #148

Open l-dobrev opened 6 years ago

l-dobrev commented 6 years ago

When a table with a pager has a relatively large number of pages (say 1000) loading takes literally minutes in which time the user interface becomes unresponsive, and the browser (tab or process) pegs the CPU at 100%.

l-dobrev commented 6 years ago

My investigation points, that the culprit is the building of the page-selection drop-down. Turns out the MaterialListValueBox by default reloads after adding every option, which ends up increasing the time taken exponentially.

Pull request with a fix incoming.

saso5 commented 6 years ago

It will still be slow on the initial load. That's why in the next release it will be replaced with an input box - https://github.com/GwtMaterialDesign/gwt-material-table/pull/128

l-dobrev commented 6 years ago

Well... The proposed fix makes loading with 1500 pages as fast as 10 pages.

Unless there is something I am missing the selector is recreated every time the page is changed, since the MaterialDataPager always calls updateUi() from onSuccess() in the LoadCallback, and updateUi() reinitialises the page selector drop-down.