HTML Preparation code:
AخA
 
1
<div id="foo"></div>
Tests:
  • style➜display

     
    document.getElementById("foo").style.display = "none";
    document.getElementById("foo").style.backgroundColor = "red";
  • setAttribute➜display

     
    document.getElementById("foo").setAttribute('style', 'background-color:red;display:none;');
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    style➜display
    setAttribute➜display

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 6 years ago)
Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3400.0 Safari/537.36
Chrome 68 on Windows 8.1
View result in a separate tab
Test name Executions per second
style➜display 710745.1 Ops/sec
setAttribute➜display 689371.5 Ops/sec