Is there a practical max number of rows for jQuery tablesorter?
I'm using the jQuery tablesorter plugin in a very simple way, to add sortability to the first four columns of a five column table. The maximum width of any of the columns is 255 characters, and most are narrower than that.
This works just fine on smaller result sets, but if my table (based on a search query) grows over ~300 rows, there is a long delay after the page displays before the DOM changes made by the tablesorter function are visible, and I often get the following bro开发者_如何转开发wser error (in Firefox):
A script on this page may be busy, or it may have stopped responding. You can stop the script now, open the script in the debugger, or let the script continue.
Script: https://foo.com/bar/js/jquery-1.3.2.min.js:19
Is there just a practical limitation for the size of a sortable table?
This depends on the speed of the machine as well as which browser people are using. To get good numbers you'd have to test using the slowest machine you'd expect people to use and find the largest set of data that could be sorted. Also the data being sorted might take longer or shorter amounts of time depending on the current order of the data.
There are a lot of variables to this problem.
Any sort implementation has a practical limitation for realtime sorting.
I've seen many sort scripts like this also combine a pagination portion so that only 50 or so are shown at a time. I'm not certain what sorting algorithm the script is using but some of them can be very slow.
This table shows the complexity of some common sort algorithms.
精彩评论