Reputation: 1396
I have a js script to get a datafeed and built some div according to the response text.
I have already used web worker and ajax to split the read datafeed and build html code process.
However while I append the html to my container, it becomes slow (let say 18000's div)
Then I change the method to append the 200 div for scroll to down of my container.
It becomes very fast, but while all items render, the other process start to become slow, for example if I make the container show and hide, it is pretty slow.
I found another solution is to use z-index, it makes the show hide process much faster.
However, while I need to change the container content, it becomes slow again.
Any idea or solution?
Upvotes: 2
Views: 2181
Reputation: 4733
I have been in this similar situation, where I was adding lot of child's to a node in a tree.
Problems
Solutions
There are lot of things that can be done tom improve this. If you can post a jsfiddle for this will certainly help.
Upvotes: 1
Reputation: 4557
Performing as many changes as possible outside of the live DOM structure will improve the performance.To know more about take the look at the How to improve the performance of your java script in your page?
Upvotes: 3