$ vs $.parseHTML

JavaScript performance comparison

Revision 90 of this test case created by Cobbweb

Preparation code

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
 
<script>
Benchmark.prototype.setup = function() {
    var someTemplate = '<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"></div></div></div>';
};
</script>

Preparation code output

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
$(someTemplate)
$(someTemplate)
pending…
$($.parseHTML(someTemplate))
$($.parseHTML(someTemplate))
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