title: What is the fastest way to get height/width of unstyled element in JavaScript?
body: <p>I came across performance issues with measuring height/width of a non-tempty unstyled element. Reading following properties seems to be very slow:</p>
  
  <pre><code>.offsetHeight
  .clientHeight
  .scrollHeight
  </code></pre>
  
  <p>I've read elsewhere that it is slow because somehow reading them causes reflow. At least, that's what I've found about <code>offsetHeight</code>, but the other two perform the same. There is some kind of quantum magic here, because logically reading a property should not cause page reflows. Anyway, is there a faster way to find width/height of an element in the easiest possible conditions, where the element doesn't have any style like <code>margin, padding, border</code> applied to it, or no other styles whatsoever?</p>
  
  <p><code>.style.height</code> just returns empty string because it only reads the values from <code>style=""</code> attribute, which is empty until explicitly defined.</p>
  
  <p>Update: <code>window.getComputedStyle(el).height</code> performs just as slow.</p>