Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1 Safari/605.1.15
Safari 11
Mac OS X 10.13.4
Other
7 years ago
Test name Executions per second
#A 4200831.5 Ops/sec
#B 576341.7 Ops/sec
#C 3975915.2 Ops/sec
#D 2134957.2 Ops/sec
#E 5884056.0 Ops/sec
#F 6115644.0 Ops/sec
HTML Preparation code:
AخA
 
1
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
Script Preparation code:
x
 
$body = $('body');
bodyEl = document.body;
var app = {};
app.getBody = function() {
  return $body;
}
app.getBody2 = function() {
  return $('body');
}
Tests:
  • #A

     
    $body
  • #B

     
    $('body')
  • #C

     
    bodyEl
  • #D

     
    document.body
  • #E

     
    app.getBody
  • #F

     
    app.getBody2