Thursday, January 17, 2008

Testing and politics

John Resig wrote an interesting piece on testing and its politics.

He poses a rather challenging question: how do we test real-world situations? Obviously that will depend on the applications themselves, but there are some things that I think are fairly global:

  1. Speed of loops. I've talked about this a long time ago, it's really easy to improve looping speed and brings about enormous performance boosts.
  2. Scalability. DOM querying sure can speed up development time, but speed degrades as more DOM nodes are present on a single page. There are tons of things that can be done about it: using native specialized code where possible (e.g. document.evaluate), passing the callback directly to the query function so that you only need one pass through the node list, instead of a get/use pair of passes, etc. There could also be more API functionality to avoid redundantly scanning nodes (e.g. updating events after an ajaxed DOM insertion). One idea I got from playing around with D is to inline stuff to deal away with function calls (thinking about those nested loops hidden within APIs again), but C-style macroing isn't supported by Javascript. Maybe someone will come up with a workaround.
  3. Animation FPS. Game developers have been striving for high frame rates for ages. It's quantizes smoothness of animation and in a slow language like Javascript, every frame counts. Pre-computing tween paths sounds promising.

There are probably more things that can be done in terms of speed optimization on the web development front, and I think that server-side code is going to become more and more important in the speed optimization field (I'll leave that discussion for another time).

No comments:

Post a Comment