clientHeight and clientWidth vs getComputedStyle() (v3)

Revision 3 of this benchmark created on


Preparation HTML

<div>
Hello world!
</div>
<script>
var div = document.getElementsByTagName("DIV")[0];
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
clientHeight and clientWidth
div.clientHeight;
div.clientWidth;
ready
getComputedStyle()
var style = window.getComputedStyle(div);
style.height;
style.width;
ready
offsetWidth and offsetHeight
div.offsetHeight;
div.offsetWidth;
ready

Revisions

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