HTML Preparation code:
AخA
 
1
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
Script Preparation code:
 
var frag = document.createDocumentFragment();
for (var i=0; i<100; i++){
  var inDiv = document.createElement('span');
  inDiv.id="s_"+i;
  inDiv.innerHTML = 'bla';
  inDiv.className = 'myclass';
  frag.appendChild(inDiv);
}
document.body.appendChild(frag);
Tests:
  • jQuery

     
    $('span.myclass').each(function () {
      $(this).html('x');
    });
  • pure JS

     
    $('span.myclass').each(function () {
      this.innerHTML = 'y';
    });
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    jQuery
    pure JS

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 12 days ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36
Chrome 134 on Windows
View result in a separate tab
Test name Executions per second
jQuery 1171.2 Ops/sec
pure JS 2031.2 Ops/sec