Automatic Semicolon Insertion versus Manual Semicolon Insertion

JavaScript performance comparison

Revision 4 of this test case created by Callum Macrae

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:

0 comments

Add a comment