Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_1) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Safari/605.1.15
Safari 13
Mac OS X 10.15.1
Desktop
5 years ago
Test name Executions per second
$jq1124 34675.2 Ops/sec
$jq224 49824.5 Ops/sec
$jq331 49781.8 Ops/sec
HTML Preparation code:
AخA
 
1
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js'></script>
2
<script>
3
  var $jq1124 = $.noConflict(true);
4
</script>
5
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
6
<script>
7
  var $jq224 = $.noConflict(true);
8
</script>
9
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
10
<script>
11
  var $jq331 = $.noConflict(true);
12
</script>
13
<div>
14
  <ul id="menu">
15
    <li class="menu-item">1</li>
16
    <li class="menu-item">2</li>
17
    <li class="menu-item">3</li>
18
    <li class="menu-item">4</li>  
19
  </ul>
20
</div>
Script Preparation code:
 
function tests($) {
    $(".menu-item").eq(2).closest("ul").css({
      "background-color": "red"
    }).parent().css({
      "border": "1px solid blue"
    }).append($("<p></p>").text("Text.").css({
      "background-color": "green"
    })).end().end().remove();
  console.log('tests' + $);
}
Tests:
  • $jq1124

     
    tests($jq1124);
  • $jq224

     
    tests($jq224);
  • $jq331

     
    tests($jq331);