[Maf] bugs and questions :-)
Molle Bestefich
molle.bestefich at gmail.com
Thu Feb 24 13:09:01 EST 2005
Christopher Ottley wrote:
> Right now I sleep a second every time. The real problem is that the
> javascript timeout is the closest thing implemented to supporting thread
> processing in javascript components. All javascript code is executed in
> the same thread (including chrome javascript I believe) so it's not
> *really* multithreaded, hence slow.
How about this:
Have a global variable name 'sleepTime', which is initially set to zero.
Hook the onBlur event for the window where you have the "loading..."
progress bar, and make it set the sleepTime to 1000 msec or so.
Hook the onFocus event for the loading window and make it set the
sleepTime to 0 again.
Then, every second or so, sleep the amount of time that sleepTime indicates.
That would throttle CPU usage down to 50% when the user clicks another
Firefox window and the 'Loading' dialog loses focus, and back up to
100% when the window receives focus again?
It would of course make loading slower when the user is idling in
another window though. Maybe it could be indicated somehow (character
processed / sec?) that the speed increases when the window is
selected, thus letting the user choose..
On the other hand, it would increase the loading speed by removing the
1s delay when the window is in focus?
Hope my idea isn't fatally flawed =)
> You can open MAF MHTs in IE and it'll work. Basically MHTs encoded by IE
> will be slow to open in Mozilla. MHTs in Mozilla will be fast to open in
> both Mozilla and IE. They will open properly either way.
Ah. Beautiful! :-)
Regards!
More information about the Maf
mailing list