Hello,
I am having an issue with IE8 performance on the website i am working on, IE6, 7 and 9 all seem fine. The site uses PIE for some elements and the CPU usage particularly on older machines goes through the roof.
Not sure exactly how to debug it but am suspecting that PIE is polling on the page to heavily and killing the CPU. I guess i could try "--pie-poll" or something to disable it but i am assuming it was enabled for a reason.
Looking at the source code(1.0beta5 uncompressed version on line 398):
Code:
PIE.Heartbeat = new PIE.Observable();
PIE.Heartbeat.run = function() {
var me = this;
if( !me.running ) {
setInterval( function() { me.fire() }, 250 );
me.running = 1;
}
};
It appears hardcoded to run every 250ms with a setInterval() call. This is fine if the page is simple and there are plenty of CPU resources available, but it needs to be less aggressive to avoid overloading the users computer.
Something like replacing the setInterval() call with:
Code:
delay = 250;
poll() { me.fire(); setTimeout(poll(), delay); }
...
if (!me.running) {
setTimeout(poll, delay);
}
The advantage of above is if the fire() method is taking a long time to run because the page is complicated or CPU poor are still guaranteed 250ms of idle time between each call. Using setInterval() if fire() takes longer than 250ms the future calls will bank up causing the users computer to become unresponsive.