Jquery vs JSDom

JavaScript performance comparison

Test case created by JSDom

Preparation code

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="http://webappers.eu/js-dom.js"></script>

<div style="position: absolute; border: 1px solid black; top: 50px; left: 30px; background: red; width: 50px; height: 50px" class="test1" id="test1">test 1</div>
<div class="test1 test2" id="test2">test 2</div>
<a href="#" class="link1" id="link1">link1</a>
<a href="#" class="link1 link2" id="link2">link2</a>
<script>
Benchmark.prototype.setup = function() {
    var lis = function(e){
       window.listenerCalls++;
    };
};
</script>

Preparation code output

test 1
test 2
link1 link2

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
js-dom
var el = Dom.id("test1");
Dom.onClick(el, lis);
Dom.dispatch(el, Dom.Event.ON_CLICK);
Dom.css(el, {"border-width" : "5px", "background-color" : "green"});
Dom.css(el, "border-color");
pending…
jquery
var el = $("#test1");
el.click(lis);
el.trigger("click");
el.css("border-width", "5px");
el.css("background-color", "green");
el.css("border-color");
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

Add a comment