block scope vs function invocation

JavaScript performance comparison

Test case created by lv2

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
block scope
var i = 0, n = 5;

l2: do {
	i += 1;
	l3: do {
		if (i<n) continue l2;
		else break l3;
	} while (true);
	break l2;
} while (true);
pending…
function scope
var i = 0, n = 5;

function l2(){
	i += 1;
}

l3: do {
	if (i<n) l2();
	else break l3;
} while (true);
pending…

You can edit these tests or add even more tests to this page by appending /edit to the URL.

Compare results of other browsers

0 Comments