homo

JavaScript performance comparison

Revision 3 of this test case created by dfgsdfgsdfgsdf

Preparation code

<ul id="groupContainer">
            <li id="groupId" class="group">
                <span id="groupBox" class="box groupName">
                    <span>Group</span>
                    <span id="add">Add</span>
                </span>
                <ul id="list">
                    <li class="box">Item 1</li>
                </ul>
            </li>
        </ul>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>

Preparation code output

  • Group Add
    • Item 1

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
1
var item = $('<li id="groupId" class="group"><span id="groupBox" class="box groupName"><span>Group</span><span id="add">Add</span></span><ul id="list"><li class="box">Item 1</li></ul></li>');

$("#groupContainer").prepend(item);
pending…
2
$("#groupContainer").prepend('<li id="groupId" class="group"><span id="groupBox" class="box groupName"><span>Group</span><span id="add">Add</span></span><ul id="list"><li class="box">Item 1</li></ul></li>');
pending…
var item = $('<li id="groupId" class="group"><span id="groupBox" class="box groupName"><span>Group</span><span id="add">Add</span></span><ul id="list"><li class="box">Item 1</li></ul></li>');

$("#groupContainer").prepend(item.clone());
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