viewport width pure js vs jquery (v8)

Revision 8 of this benchmark created by Tri on


Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>

Setup

var $win = $(window), docElem = document.documentElement;
    
    var w;

Test runner

Ready to run.

Testing in
TestOps/sec
jQuery
w=$win.width();
 
ready
clientWidth
w=(docElem.clientWidth);
ready
innerWidth
w=window.innerWidth
ready

Revisions

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