Testing Array Parsing

JavaScript performance comparison

Test case created by

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
Method 1
var wb = {};
wb.SheetNames = ["Sheet1", "Sheet2", "Sheet3"];
var sheetname = "Sheet1";
var index = 2;

var SheetExists;
for (var i = 0; i < wb.SheetNames.length; ++i) {
  if (wb.SheetNames[i] === sheetname) {
    SheetExists = true;
    wb.SheetNames.splice(i, 1);
    wb.SheetNames.splice(index, 0, sheetname);
  };
};
if (!SheetExists) {

};
pending…
Method 2
var wb = {};
wb.SheetNames = ["Sheet1", "Sheet2", "Sheet3"];
var sheetname = "Sheet1";
var index = 2;

var ind = wb.SheetNames.indexOf(sheetname);
if (ind === -1) {

};
wb.SheetNames.splice(ind, 1);
wb.SheetNames.splice(index, 0, sheetname);
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