Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Revenge of the Timers

DZone's Guide to

Revenge of the Timers

· Web Dev Zone
Free Resource

Never build auth again! Okta makes it simple to implement authentication, authorization, MFA and more in minutes. Try the free developer API today! 

After my earlier post on analyzing JavaScript timer performance a lot has changed, especially in Firefox 3. An excellent patch landed the other day which is giving us some excellent performance improvements - not the least of which is related to timers.

If you remember from before I took a look at how responsive JavaScript timers were on OSX in Firefox 2, Safari 3, Firefox 3, and Opera 9. The conclusion, at least for me, was that Firefox 3's timers were much improved over Firefox 2's, but could stand some improvement.

I filed a couple bugs, relating to the matter:

And to my delight this new patch completely resolves all of them. Let's take a quick peak at the results. These are the results of doing setInterval(fn, 0); in Firefox 2, Safari 3, Firefox 3, and Opera 9. Firefox 3 is in the bottom-left corner, note the improvement.

Before

After

The change in quality is startling. It's easy to say that Firefox 3 and Safari 3 are quite comparable now, in terms of overall timer quality and, if nothing else, a major improvement over the timers in Firefox 2.

If you want to try this improvement for yourself feel free to download a nightly of Firefox 3 and head on over to the timer test page, I think you'll be quite pleased.

Launch your application faster with Okta’s user management API. Register today for the free forever developer edition!

Topics:

Published at DZone with permission of John Resig. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}