Single, combined var statement.

JavaScript performance comparison

Revision 2 of this test case created by Joel

Info

Rev2 is just adding more stuff

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
single
var a = 1,
    b = 1,
    c = 1,
    d = 1,
    e = 1,
    f = 1,
    g = 1,
    h = 1,
    i = 1,
    j = 1,
    k = 1,
    l = 1,
    m = 1,
    n = 1,
    o = 1,
    p = "a",
    q = "a",
    r = "a",
    s = "a",
    t = "a",
    u = "a",
    v = "a",
    aa = {},
    bb = {},
    cc = {},
    dd = {},
    ee = {},
    ff = [],
    gg = [],
    hh = [],
    ii = [];
pending…
combined
var a = 1;
var b = 1;
var c = 1;
var d = 1;
var e = 1;
var f = 1;
var g = 1;
var h = 1;
var i = 1;
var j = 1;
var k = 1;
var l = 1;
var m = 1;
var n = 1;
var o = 1;
var p = "a";
var q = "a";
var r = "a";
var s = "a";
var t = "a";
var u = "a";
var v = "a";
var aa = {};
var bb = {};
var cc = {};
var dd = {};
var ee = {};
var ff = [];
var gg = [];
var hh = [];
var ii = [];
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