getBoundingClientRect vs jQuery (v17)

Revision 17 of this benchmark created by Eamon Nerbonne on


Preparation HTML

<script src="//code.jquery.com/jquery-2.1.0.min.js">
</script>
<div id="foo" style="width:500px; height:500px; padding:10px; border:10px solid #000000;">
</div>
<script>
var sink;
</script>

Setup

var $foo = $('#foo');
    var foo = $foo[0];

Test runner

Ready to run.

Testing in
TestOps/sec
getBoundingClientRect
sink=foo.getBoundingClientRect();
ready
jQuery
sink=$foo.offset();
ready
offsetTop
sink=foo.offsetTop;
ready

Revisions

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