Skip to content
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

Sorting VERY SLOW (8s) with only 11 rows #373

Closed
pkkid opened this issue Sep 5, 2013 · 3 comments
Closed

Sorting VERY SLOW (8s) with only 11 rows #373

pkkid opened this issue Sep 5, 2013 · 3 comments
Labels

Comments

@pkkid
Copy link

pkkid commented Sep 5, 2013

Long (140 char) string values in a cell are causing tablesorter to be VERY slow. I have 11 rows in my table, and sorting is taking upwards of 8s. It seems the direction of sorting also has a large impact on performance as well. It gets gets worse with each row added and actually causes FF to popup the "Long Running Script" message, killing the page.

A JSFiddle example here (try sorting by Name):
http://jsfiddle.net/EvHR9/1/

With debug on, I am getting these messages:

Sorting on 0,0 and dir 0 time (2172ms) [VM] jquery.tablesorter.js (2583):111
Rebuilt table (1ms) [VM] jquery.tablesorter.js (2583):111
Completed applying 0 widgets (0ms)

Sorting on 0,1 and dir 1 time (8696ms) [VM] jquery.tablesorter.js (2583):111
Rebuilt table (1ms) [VM] jquery.tablesorter.js (2583):111
Completed applying 0 widgets (0ms)

It should also be worth noting that I tried updating to the latest v2.10.8 codebase and am seeing the same problem.

@Mottie
Copy link
Owner

Mottie commented Sep 13, 2013

Hmm, that is really slow. But I think it is slow because the data in all those cells is exactly the same and it's attempting to do it alphanumerically - which should be chunking the data, so it shouldn't be "that" slow. I'll have to dig into this more when I get back. For right now, I would recommend moving the "alpha"-part (MySnmp) into another column (demo)

@Mottie
Copy link
Owner

Mottie commented Oct 8, 2013

I found the problem, I'll have it fixed in the next update.... basically I'm just going to remove the sorting of dates by the natural sorter since in tablesorter we use parsers to detect and convert dates into numbers.

@pkkid
Copy link
Author

pkkid commented Oct 8, 2013

Awesome. I appreciate you looking into this, and for the great app in the first place.

@Mottie Mottie closed this as completed in 6b7b842 Oct 11, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants