A 'Sorting' Puzzle

D

Dr J R Stockton

Thu said:
So, I guess the 'rebuild' of the table is where it takes most of the
time.

Try NOT rebuilding the table; try instead just changing the contents of
each cell, setting them all to one preexisting Object.

As a test of that, you can first build a table of similar size by a
method akin to your rebuilding, but in which all the cells contain a
particular string of representative length. Time that, then time
walking the table by indexed rows and cols, and by using the "family"
routines, reading each cell and rewriting it while doing so.

Try also setting the Table to visibility hidden or display none while
writing to it. It might make a difference in some browsers, those that
try to show things as they happen. Probably it will not, but it should
be easy enough to check.
 
D

Denis McMahon

Try NOT rebuilding the table; try instead just changing the contents of
each cell, setting them all to one preexisting Object.

Yes, I'd come to that conclusion some time ago and implemented it.

Rgds

Denis McMahon
 
T

Thomas 'PointedEars' Lahn

Dr said:
Mel Smith posted:

Try NOT rebuilding the table; try instead just changing the contents of
each cell, setting them all to one preexisting Object.

This is particularly bad advice. Changing the contents of each cell does
not change its ID or class, and the stylesheet applying to it, for example.
And it is arguably magnitudes less efficient than just switching the order
of row objects in a NodeList.


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top