Mottie/tablesorter — pull request #711 by camallen (2014-08-24 12:20:43+00:00)
Title: Pager widget - slow table update when there are a large number of page number links

I am using the pager widget with server side filtering. When paged results where being returned the pager's 'goto' page links get being updated. For large page sets the browser slows noticeable (sometimes even causing *unresponsive script* errors) while inserting / replacing a large list of 'option' goto page links.

You can simulate the issue by replacing `pg = Math.min( p.totalPages, p.filteredPages );` with a large value, my page set was something like 25K `pg = 25000;` and then watch your browser slow down on render

I couldn't get a faster DOM insert / update mechanism working properly, see:
+ http://stackoverflow.com/questions/3756839/best-way-to-insert-hundreds-of-dom-elements-into-the-page-dynamically-while-keep
+ http://jsperf.com/innerhtml-vs-replacehtml

Instead I've created a representative sample into the page number options links skipping a number of records based on a 'max_option_size' value.

This might not be a great solution for everyone but it works for me. Perhaps this PR will save someone a few hours and possibly start a discussion re large page links sets slowing down the browser.