vars

JavaScript performance comparison

Revision 11 of this test case created

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
var inside function
function a() {
        var doctypesValides = {
            '': '',  /* DOCTYPE normal */
            '-//W3C//DTD XHTML 1.1//EN': 'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd',
                '-//W3C//DTD XHTML Basic 1.0//EN': 'http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd',
                '-//W3C//DTD XHTML Basic 1.1//EN': 'http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd',
                '-//W3C//DTD XHTML 1.0 Frameset//EN': 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd',
                '-//W3C//DTD XHTML 1.0 Transitional//EN': 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd',
                '-//W3C//DTD XHTML 1.0 Strict//EN': 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd',
                '-//W3C//DTD HTML 4.01//EN': 'http://www.w3.org/TR/html4/strict.dtd',
                '-//W3C//DTD HTML 4.01 Frameset//EN': 'http://www.w3.org/TR/html4/frameset.dtd',
                '-//W3C//DTD HTML 4.01 Transitional//EN': 'http://www.w3.org/TR/html4/loose.dtd',
                '-//W3C//DTD MathML 2.0//EN': 'http://www.w3.org/Math/DTD/mathml2/mathml2.dtd',
                '-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN': 'http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd',
                '-//W3C//DTD SVG 1.0//EN': 'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd',
                '-//W3C//DTD SVG 1.1//EN': 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd',
                '-//W3C//DTD SVG 1.1 Basic//EN': 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd',
                '-//W3C//DTD SVG 1.1 Tiny//EN': 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd',
        };
}
for (var i; i < 1000; i++) a()
pending…
var outside function
        var doctypesValides = {
            '': '',  /* DOCTYPE normal */
            '-//W3C//DTD XHTML 1.1//EN': 'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd',
                '-//W3C//DTD XHTML Basic 1.0//EN': 'http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd',
                '-//W3C//DTD XHTML Basic 1.1//EN': 'http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd',
                '-//W3C//DTD XHTML 1.0 Frameset//EN': 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd',
                '-//W3C//DTD XHTML 1.0 Transitional//EN': 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd',
                '-//W3C//DTD XHTML 1.0 Strict//EN': 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd',
                '-//W3C//DTD HTML 4.01//EN': 'http://www.w3.org/TR/html4/strict.dtd',
                '-//W3C//DTD HTML 4.01 Frameset//EN': 'http://www.w3.org/TR/html4/frameset.dtd',
                '-//W3C//DTD HTML 4.01 Transitional//EN': 'http://www.w3.org/TR/html4/loose.dtd',
                '-//W3C//DTD MathML 2.0//EN': 'http://www.w3.org/Math/DTD/mathml2/mathml2.dtd',
                '-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN': 'http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd',
                '-//W3C//DTD SVG 1.0//EN': 'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd',
                '-//W3C//DTD SVG 1.1//EN': 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd',
                '-//W3C//DTD SVG 1.1 Basic//EN': 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd',
                '-//W3C//DTD SVG 1.1 Tiny//EN': 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd',
        };
function a() {
}
for (var i; i < 1000; i++) a()
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