Mr Speaker

Long jQuery fades eats CPU

While doing a little refreshing around these parts I noticed that the "fading bubbles" that I have were chewing up a ridiculous amount of CPU when the page loaded. I had 15 or so bubbles rigged to fade in verrrrrry slowly - over 20 seconds - after window.onload fired. I thought I must have had some crazy infinite loop or some such, but no... after whittling things down I ended up creating this test page:

jQuery long fade test

If you open up Activity Monitor and click the "big fade" button, the screen will slowly fade in (to background colour #bada55, naturally) and your CPU will say bye-bye. Similarly, if you fade in a bunch of items over a long time you'll see a pretty serious drain too.

I haven't gone looking over on the mailing lists to see if this is a "known issue", or started digging into the source, 'cause I'm a lil' pressed for time at the moment - but if you found this page while googlin' to fix your fading woes, I feel your pain and will tell you to do what I shoulda done: use CSS transitions!

Finally, while checking I used the correct spelling of "whittling" I found this statement on the official whittling website:

Welcome to the world of whittling, a hobby for some, an obsession for others, a joy for all.

I'm a fan of whittling and all, but that just seems like a logical fallacy to me.

Captcha! Please type 'radical' here: *
How did you find this thingo? *