Thursday, May 8, 2008

Milliseconds Matter

In the pursuit of creating blazingly fast web applications, we spend hours benchmarking, profiling, and optimizing to shave off precious milliseconds. But what is a millisecond?

I found it interesting to take a step back today and remind myself what a millisecond feels like.

Enter a delay in the text box and then click the white boxes to reveal a super secret message. The delay represents hard work the app has to perform in order to decrypt the message.

At what threshold does the delay begin to annoy you? For me it was about 300ms.



Inline frame not working? Here's a link to the demo.

Monday, May 5, 2008

JsBench Help

JsBench now has a help page with information on how to get started, an explanation of the benchmark methodology, and some examples. Check it out and feel free to let me know if anything is missing.

Saturday, April 26, 2008

JsBench

In the search for techniques to produce truly blazing JavaScript, I've found lots of conflicting and downright misinformation on the web. When Googe's App Engine was released, I decided to kill two birds with one stone: (1) play with App Engine and (2) create a tool for sharing real world cross browser JavaScript benchmarks.

Try it out:
http://jsbench.appspot.com/

JsBench

If you aren't sure how to get started, check out some of my experiments.

For instance, did you know that using the Boolean() constructor is perhaps the slowest way to create a boolean? In some cases it can be as much as an order of magnitude slower than alternate methods.
http://jsbench.appspot.com/#suite=agdqc2JlbmNocgwLEgVTdWl0ZRiaAgw

Also, if you've been using a for..in loops when they aren't necessary, your code is probably running more than ten times slower than it has to if you'd used a typical for-loop and cached the length.
http://jsbench.appspot.com/#suite=agdqc2JlbmNocgsLEgVTdWl0ZRgNDA


Oh, and the last bit for now is that you better not even think of omitting the "var" statement when creating a new variable. Doing so could be slowing you down by two orders of magnitude!
http://jsbench.appspot.com/#suite=agdqc2JlbmNocgwLEgVTdWl0ZRjqAgw

Look for some more specific, in depth studies to come. What examples can you come up with?

FireBUGs

After a long period of forgetting this blog existing, I figured its about time to pick it up again. Recently I've become interested in lending a hand to the Firebug Working Group to help fix some of the 341 open bugs and feature requests:
http://code.google.com/p/fbug/issues/list

Here's my first patch:
http://code.google.com/p/fbug/issues/detail?id=43