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

    x
     
    var i = 5000;
    while (i--) {
        checkDisplay('foo');
    }
    function checkDisplay(id) {
        return window.getComputedStyle(document.getElementById(id), null).getPropertyValue("display") === "none";
    }
  • getBoundingClientRect

     
    var i = 5000;
    while (i--) {
        checkDisplay('foo');
    }
    function checkDisplay(id) {
        return document.getElementById(id).getBoundingClientRect().width === 0;
    }
  • clientheight

     
    var i = 5000;
    while (i--) {
        checkDisplay('foo');
    }
    function checkDisplay(id) {
        return document.getElementById(id).clientHeight === 0;
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    getComputedStyle
    getBoundingClientRect
    clientheight

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 8 months ago)
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0
Firefox 128 on Ubuntu
View result in a separate tab
Test name Executions per second
getComputedStyle 213.1 Ops/sec
getBoundingClientRect 368.7 Ops/sec
clientheight 817.7 Ops/sec