dojo.position vs clientWidth (v2)

Revision 2 of this benchmark created on


Description

Which is faster reading the clientWidth or dojo.position (which uses bounding client rect)

Preparation HTML

<div id="test">
<p>Some text </p>
</div><script src="//ajax.googleapis.com/ajax/libs/dojo/1/dojo/dojo.xd.js"></script>

Setup

var node = dojo.byId("test");

Test runner

Ready to run.

Testing in
TestOps/sec
clientWidth
var x = node.clientWidth;
ready
position
var x = dojo.position(node).w;
ready

Revisions

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