Jquery-Vs-Native-With-Preporation

Benchmark created by Hawkwind on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<div id="testContainer">
</div>
 
<script>
  var jqContainer = $('#testContainer');
  var nativeContainer = document.getElementById('testContainer');
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Native
nativeContainer.style.height = 100 + 'px';
nativeContainer.style.width = 200 + 'px';
ready
jQuery.CSS
jqContainer.css({
  'height': 100,
  'width': 200
});
ready
jQuery.width/height
jqContainer.width(100);
jqContainer.height(200);
ready

Revisions

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

  • Revision 1: published by Hawkwind on