Automatic Semicolon Insertion versus Manual Semicolon Insertion

JavaScript performance comparison

Test case created by Heath Matlock and last updated

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
asi
function square(number) {
  var result = number * number
  return result
}

var c = 0

while (c < 100) {
  if (typeof c === 'number') {
    square(c)
    c += 1
  }
}
pending…
msi
function square(number) {
  var result = number * number;
  return result;
};

var c = 0;

while (c < 100) {
  if (typeof c === 'number') {
    square(c);
    c += 1;
  };
};
pending…
asi-minified
function square(a){return a*a}for(var c=0;100>c;)"number"===typeof c&&(square(c),c+=1)
pending…
msi-minified
function square(a){return a*a;}for(var c=0;100>c;)"number"===typeof c&&(square(c),c+=1);
pending…

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:

1 comment

uytutyu commented :

tyutyu

Add a comment