The wasteful nature of pointless JavaScript effects.

Earlier today I witnessed the wasteful nature of pointless JavaScript effects first-hand at the Blogger main page. The effect in question is visible under the “BLOGS UPDATED AT …” text immediately under the Blogger logo. In short, the effect involves the title of a recently-updated blog fading away every second or so, to be replaced with the title of another blog. So as can clearly be seen, it’s not essential in any way. It’s completely cosmetic, although it doesn’t even look particularly good.

The main problem with this particular effect is that it causes CPU spikes, at least with certain browsers. I first noticed the problem after visiting the site using Firefox. Soon enough after visiting the page, I began to notice that the CPU load graph in my deskbar was showing 100% spikes about every 1 second. Because of the fading nature of the effect, these spikes lasted about 500 ms. It was only for the first 500 ms or so of each displayed blog title, when the text was first displayed, that the CPU was released.

I thought that the problem might just be related to Gecko’s JavaScript implementation. So I decided to give Konqueror a try, but it gave much the same problem. However, it didn’t peak at 100% for as long as Firefox did.

I also gave Opera a try. It did not exhibit such behaviour. The CPU consumption didn’t hit 100%. It didn’t appear to even exceed 10%. So it looks like Opera is clearly the superior browser in this case.

Finally, I tried again with Seamonkey, although it uses the Gecko rendering engine, as does Firefox. I got the same results as when using Firefox, as would be expected.

I think that this situation really indicates the poor nature of JavaScript-based applications running in Web browsers. It’s pretty pathetic when a relatively simple, and rather pointless, effect requires so much processing power.

So when people say that JavaScript-based Web applications are the future, I have to chuckle. What they’re advocating is nothing be a devolution. So now we’re able to create pointless effects that consume relatively massive amounts of processing power. And what have we gained? A drop in overall system performance. Wasted CPU cycles. Wasted RAM, as well, for the JavaScript implementation. Essentially, we’ve made no gain of any kind.

Leave a Reply

*
To protect against spam, please type the word in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word