jq vs js test

Benchmark created on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

Setup

var docBody = document.body;
    var docElement = document.documentElement;
    var docHeight;

Test runner

Ready to run.

Testing in
TestOps/sec
test 1
                    docHeight = Math.max(
                      docBody.scrollHeight, docElement.scrollHeight,
                      docBody.offsetHeight, docElement.offsetHeight,
                      docElement.clientHeight
                    );

                    try {
                      parent.TwitterACP.Templates.T05_LearningModule.ResizeIframe(height);
                    } catch (err) {};
ready
test 2
var height = $("body").outerHeight(true) + $("body").offset().top;

try {
  parent.TwitterACP.Templates.T05_LearningModule.ResizeIframe(height);
} catch (err) {};
ready

Revisions

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