HubSpot / sortable

Drop-in script to make tables sortable
http://github.hubspot.com/sortable/docs/welcome
MIT License
1.33k stars 115 forks source link

Pagination and performance for larger datasets #50

Open tommiehansen opened 7 years ago

tommiehansen commented 7 years ago

This seems to be a great plugin except that it doesn't support larger tables due to performance reasons. Anything over 1000 rows x 6 columns start to become slow and over 3000 is really slow.

That mostly have to do with the browser(s) inability to handle the thousands of DOM-nodes required. Therefor an extension ie Pagination to not draw each single TR and TD for larger datasets would be useful.

Along with pagination another useful thing would be the ability to create the table from an index ie an array. This due to the fact that performance (if only showing X rows out of Y number of total) is much better if we don't even have to loop the initial table cells in the DOM but rather have an array (or object) from the beginning to deal with.

tl;dr

  1. Limit DOM-nodes for larger data-sets
  2. Add pagination for larger data-sets
hjacobs commented 3 years ago

I created a PR with a fix to make large tables much faster to sort: #54