First off, I examined the load times using the excellent Firebug plug-in and the Charles web debugging proxy and I found that the xml, while large, was not taking more than half a second to load. Also the page and other parts were likewise loading quickly so I knew that the problem lay on the front end. I originally suspected that the XML transform was at fault so I cut out pieces and found that the XML transform was being completed in one second or less. Therefore, the only thing left was the browser's display time for large amounts of HTML data. In order to get it to display less, we either had to add a search filter, or some other kind of filter.
As a preliminary step, since we had built an Alpha Search Tree, I proceeded to make it only load onto the page the items who matched the first letter (or number) detected. By only loading to the page one letter at a time, we cut load times to a 20th of their original size.
Here are some of the code examples of how this is accomplished: http://graphix.bizland.com/js/CheckLetters.txt
http://graphix.bizland.com/js/SetLetter.txt
Firstly we need to build a list of indexed letters corresponding to the first letters of the Items to be displayed in our list so that we can build the menu:
The showLetter function is called when we click on a letter and it adds the current letter to the xml and removes the previous one selected.
Which makes sure we only transform rows where the name starts with the same letter and we end up with something like this:
No comments:
Post a Comment