HTML Preparation code:
x
 
1
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
2
<script>
3
    var $jq331 = $.noConflict(true);
4
</script>
5
6
<div id="box" style="background:#555;color:#FFF;position:absolute;left:0;top:0;width:400px;height:100px;</div>
Script Preparation code:
 
var elem = document.getElementById('box');
console.log("elem", elem);
console.log("jq", $jq331);
var jqElem = $jq331('#box')
console.log("jqElem", jqElem);
Tests:
  • cssText

     
    elem.style.cssText +=';width:300px;height:50px;';
  • style

     
    elem.style.width = '300px';
    elem.style.height = '50px';
    elem.style.top = '40px';
    elem.style.left = '90px';
  • jquery

     
    jqElem.css({ 'width': 300, 'height': 50, 'top':40, 'left': 90 });
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    cssText
    style
    jquery

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 3 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36
Chrome 98 on Windows
View result in a separate tab
Test name Executions per second
cssText 112594.2 Ops/sec
style 440300.8 Ops/sec
jquery 116921.3 Ops/sec