Class vs. Style Javascript Performance

A lovely simple test-case on the performance differences between four basic operations. The results are baffling; I tested on WebKit, Gecko and Opera on OS X and IE8 on XP, and there is a consistent 80 – 95% performance increase when setting a class name over a style attribute.

Another nice tidbit is that IE8 is 50x slower than WebKit. (via)