It has been several years since I last coded any javascript by hand. Since it’s a pain to test in different browsers and does not come with smart methods built-in, it is always easier to use an existing framework such as jQuery (current favorite), Prototype or Mootools. But which one to choose? There’s now a page to test performance of every javascript framework.
It’s hosted by Mootools so you have to wonder how objective it is. But: the results make sense to me. My previous framework of choice, Prototype, is very slow. The end result on my browser is 161. jQuery is pretty fast at 80; as fast as Mootools itself. The clear winner is Dojo however: end result 25! These are relative numbers, but impressive nonetheless.
What have I learned?
- do not use prototype. it’s just too slow.
- Dojo is lightning fast, but does not offer all plugins I need (validation)
- jQuery is the best choice for me at the moment.
I have recently started using Google Code to host my javascript libraries. Since it slashes performance of my websites, it makes sense. Of course, “they” will see who is using those libs from their servers and “they” will undoubtedly do evil things with that knowledge. Fine. I’ve seen load-times halved and all sites I maintain have Google Analytics loaded anyway, so the discussion is moot.