| Page 1 of 1 | [ 4 posts ] |
|
Hi.
We have an application being developed using YUI2 which seems to perform very well in Chrome but quickly grinds to a halt using IE (we've used both versions 7 and 8 with similar results). One area we've identified is the creation of TreeNode objects which seems to take a lot longer in IE (60s+ compared to sub-second in Chrome) - granted the numbers are large, around 3000, but these nodes are not visible initially and it simply seems to be creation of the objects that takes the bulk of the time. Even when we restrict the number of treenodes being created to around 100 the whole resposiveness of the UI still seems to suffer - such as using the scrollbar or reszing the window 'freezes' for several seconds before responding. In addition I find the application in IE feels sluggish in general so I suspect that the treenode is only one instance of a more common problem. Chrome doesn't appear to become sluggish with the same pages. To my mind this sort of behaviour point to lots of event listeners being created and accessed during normal UI operations - for instance if we disable the display of tooltips then it does seem to improve the UI suggishness which might be because there are less mouseover events? However tooltips and 'drag and drop' are essential to the application - as is IE support. Does anyone know if IE handles events significantly differently from Chrome or Firefox? Or does this sound like something else? We could look at migrating to using YUI3 and using delegate event handlers if that is likely to solve the problem, but it seems strange that there is such a vast difference between IE and other browsers and I'm wondering if we're just doing something silly? I'm at a loss as to how to investigate and diagnose this performance problem any further... any suggestions welcome. Kind Regards, Andy |
|
IE is significantly slower than any other browser. There is, indeed, a very different way in which IE handles events from any other: they do it badly.
ToolTips and drag and drop are not built-in features of TreeView so I guess that those were added by you. And since you mention event delegation as a YUI3 feature, I would like to mention that you can do event delegation very easily in YUI2 as well and that without even bothering with the event-delegate module. |
|
Hi Satyam,
Thanks for the quick reply. You're right about the tooltips being added - they are implemented using the tooltip widget in YUI... Seeing how removing them made a noticable difference I guess the question is also what sort of overhead do they place on the browser when there are hundreds of them and are there any alternatives? Cheers, Andy |
|
Indeed, there is. I was faced with the same issue trying to put tooltips on a DataTable. I made this example to show the principle. Of course, the example has only a few rows, but in my actual application, there were too many cells.
Instead of making an enormous array of triggers for the ToolTip, you can use event delegation on the container of them all as I did in this example for the DataTable. I checked whether the elements receiving the event were the table cells I cared for, you would have to check for the target being the TreeNode elements you care for. |
| Page 1 of 1 | [ 4 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group