How fast is modern browser?

You know that very recently we have been “blessed” with 3 spanking new , fully compliant and very fast browsers.

But do You actually have a real feel for “fast” in the context of Your browser? Do You know what do we mean by “fast”, in this context? Well. To help You understand how fast is fast in here I can “reveal” to You that I have made one very short JavaScript example that is using Flot™ library and jQuery™.


Above you can see one near-time example, of continuous data set production and it’s repeated re-draw-ing. The axes are automatically scaled. I think for scripting language this is pretty damn fast.

And here is the amazingly short piece of JavaScript behind. Calculate two data sets, and then just redraw using them. Repeat.
[sourcecode language=”javascript”] $(function () {
var flot = null ,
new_dataset = function ( hF_, size_ ) {
var d1 = [], d2 = [], size = size_ || 1400, hF = hF_ || (20 * Math.random()) ;
for (var i = 0; i < size; i += hF ) {
d1.push([i, Math.sin(i)]);
d2.push([i, Math.cos(i)]);
}
return [d1,d2] ;
},
maxi = 1000,
$counter = $("#counter"),
tid = setInterval ( function () {
if ( 0 > maxi– ) { clearInterval(tid); return; }
$counter.html( "" + maxi ) ;
flot = $.plot($("#placeholder"), new_dataset());
flot.draw();
}, 1 ) ;
});
[/sourcecode] Enjoy…