Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
jQuery vs pure JS : html
innerHTML vs html
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (iPhone; CPU iPhone OS 17_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/129.0.6668.46 Mobile/15E148 Safari/604.1
Browser:
Chrome Mobile iOS 129
Operating system:
iOS 17.6
Device Platform:
Mobile
Date tested:
one year ago
Test name
Executions per second
jQuery
8015.7 Ops/sec
pure JS
14571.4 Ops/sec
HTML Preparation code:
<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'; });