html insertion js vs jquery (v5)

Revision 5 of this benchmark created on


Preparation HTML

<div id='test1' style='overflow: scroll; height: 100px'></div>
<div id='test2' style='overflow: scroll; height: 100px'></div>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

Setup

var content = [];
    content.push('<embed src="http://flockdraw.com/whiteboard-ng.swf?21" flashvars="room=75slwp" allowfullscreen="true" wmode="transparent" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" height="620" width="1000">');
  
  content = content.join(' ');

Test runner

Ready to run.

Testing in
TestOps/sec
jquery
var $t2 = $('#test2');
var $d = $('<div></div>');
$d.html(content);
$t2.append($d);
ready
plain js
var t1 = document.getElementById("test1");
var d = document.createElement("div");
d.innerHTML = content;
t1.appendChild(d);
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.