Re: YUI Event - Performance hit - CPU Usage 90% average in IE6
- Hello Achyuth, sorry for the delay, here is what I think:
POLL_RETRY and POLL_INTERVAL both are used only before the onLoad event, I can't tell
you exactly which is the impact of modifying them, but both values will create a
verification cycle for onAvailable and onDOMReady methods in the YUI EVENT utility,
mainly used to apply listeners and expand the DOM structure.
Increasing these values will cause that some of the DOM element will be displayed on the
page without the corresponding listeners for a while, and also some of the dynamic
elements that need to be expanded (ex. YUI Menus from JS) will be rendered late, specially
for high-speed clients. I've been testing the YUI framework and my Bubbling Extension in
a real overloaded environment, and everything has worked fine without modifying those
Now that I mention the listeners, I can tell you that too many listeners will have a serious
impact in your application, specially in IE. So try to bubble up the events to decrease the
number of listeners in your page.
Caridy (caridy at gmail.com)
> Thanks Caridy for your timely response & suggestion. We are making sure
> that approach is search element by ID only in entire page.
> We happened to profile the IE 6 last day and our reports show that the
> high CPU happened in the UI thread IE window. The report states IE was
> busy with script code from yahoo-dom-event.js. The script function is:
> This is the one triggered by timeout until the interval is cleared or
> in other words "loadComplete" is set to 1.
> loadComplete function from yahoo-dom-event.js has predefined
> POLL_RETRYS:4000 and POLL_INTERVAL:10. It means the interval of the
> timeout function is 0.01 seconds and the script function is called 100
> times per seconds if clearInterval() is not executed.
> With given understanding I changed the retrys to 4 and POLL_INTERVAL to
> 100 and now I see a drastic change in CPU usage. After the page load in
> IE6 immediately CPU usage is fallen down to 15%. But however am not sure
> what other impact does this change have. The event consumption for
> further actions within the page is slightly delayed in ms (which is not
> I appreciate if you can help me understand how POLL_INTERVAL/RETRYS work
> and at the same time the impact on increasing the interval time.
> Thanks & Regards,
> <caridy@> wrote:
> > Hello Achyuth:
> > Usually IE6 cries like a baby when you're walking the DOM and gets CPU
> intensive, Safari,
> > Firefox, Opera and IE7 can do it nicely. So try to minimize the use of
> > getElementsByClassName and getElementsByTagName instead use
> getElementByTagId and
> (js files that are
> > optional), moving them to the end of the DOM structure or loading it
> on demand after the
> > DOM ready.
> > Will be nice if you post an URI, I'm sure that someone will help you
> to improve it.
> > Best Regards,
> > Caridy (caridy at gmail.com)
> > http://www.bubbling-library.com/
> > >
> > > Hi Dear,
> > >
> > > We are experiencing the performance issues in IE6. We are using YUI
> > > and Drop, Menu, Datatable, Panels components. The scenario is that
> > > loading the page (from server) the CPU usage spikes to 99%. To my
> > > surprise after the page load also (for minutes together) IE6 is busy
> > > doing something with 90% CPU usage. Our site is compatible to IE 6 &
> > > Mozilla Firefox. We are experiencing the CPU usage problem in IE 6
> > > whereas in Mozilla Firefox we can observe the CPU usage coming down
> > > 20% gradually.
> > >
> > > The data in Data table is loaded/saved through AJAX calls.
> > >
> > >
> > > I can not imagine how patiently user would have to work on this page
> > > be launched. Please suggest on this immediately. Thanking you in
> > > advance.
> > >
> > >
> > > Regards
> > >