This benchmark code on longterm loan from http://akdubya.github.com/dustjs/