FasterDom test (v12)

Revision 12 of this benchmark created on


Preparation HTML

<script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
<script src="http://wilsonpage.github.io/fastdom/fastdom.js"></script>
<script src="http://wilsonpage.github.io/jquery-fastdom/index.js"></script>
<div id='box'>
</div>
<div id='some_elem'>
</div>

Setup

Benchmark.prototype.setup = function() {
      var box = document.getElementById("box");
      var strr = "<div class='class1'></div><div class='class1'></div>";
      box.innerHTML = strr;
    };

Teardown


    Benchmark.prototype.teardown = function() {
      var box = document.getElementById("box");
      var strr = "<div class='class1'></div><div class='class1'></div>";
      box.innerHTML = strr;
    };
  

Test runner

Ready to run.

Testing in
TestOps/sec
fastdome html
 var dom =  new fastdom(".class1");
dom.html("fastdome");
ready
jquery html
$(".class1").html("22");
ready
jquery css
 $(".class1").css({width: '100px'});
ready
fastdom css
Var result = new fastdom(".class1").css({width: '5px'});
ready
fastdom hide
new fastdom(".class1").hide();
ready
fastdom show
new fastdom(".class1").show();
ready
jquery hide
  $(".class1").hide();
ready
jquery show
  $(".class1").show();
ready
jquery prepend
 var doc = document.createElement('div');
                    $(".class1").prepend($(doc));
ready
fastdom prepend
 var doms = new fastdom(".class1");
                    var doc = document.createElement('p');
                    doms.prepend(doc);
ready
fastdom prepend string
 var doms = new fastdom(".class1");
                    doms.prepend("wutwut");
ready
jquery prepend string
                    $(".class1").prepend("wutwut");
ready
fastdome id html
new fastdom("#some_elem").html("fastdome");
 
ready
jquery id html
$("#some_elem").html("jquery html");
ready
fastdom single attr
new fastdom("#some_elem").attr("class","someclass");
ready
jquery single attr
$("#some_elem").attr("class","wuupp");
ready
fastdom single css
new fastdom("#some_elem").css({"width":"5px"});
ready
jquery single css
$("#some_elem").css({"width":"5px"});
ready

Revisions

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