reflow (v2)

Revision 2 of this benchmark created by collapick on


Description

Test for reflow. How much faster is to hide elements then removing and adding those to DOM

Preparation HTML

<div>
  <span id="test"></span>       
</div>

<div>
<span id="test2">
    <a href="#">click1</a><a href="#">click2</a>
</span>
</div>

Test runner

Ready to run.

Testing in
TestOps/sec
reflow
var element = document.getElementById('test');
element.innerHTML = '';
element.innerHTML = '<a href="#">click1</a><a href="#">click2</a>';
ready
hide
var element2 = document.getElementById('test2');
element2.style.display = "none";
element2.style.display = "block";
ready

Revisions

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

  • Revision 2: published by collapick on