Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36
Chrome 92
Mac OS X 10.13.4
Desktop
3 years ago
Test name Executions per second
Vanilla Get ID 2909489.8 Ops/sec
Vanilla Get Text 1704138.1 Ops/sec
Vanilla Get Html 502001.6 Ops/sec
jQuery Get ID 938097.7 Ops/sec
jQuery Get Text 545063.9 Ops/sec
jQuery Get Html 363192.8 Ops/sec
Zepto Get ID 958296.6 Ops/sec
Zepto Get Text 494966.9 Ops/sec
Zepto Get Html 385796.1 Ops/sec
Bliss Get ID 1093877.4 Ops/sec
Bliss Get Text 861520.1 Ops/sec
Bliss Get Html 862724.8 Ops/sec
Umbrella Get ID 226922.1 Ops/sec
Umbrella Get Text 208478.0 Ops/sec
Umbrella Get HTML 165633.1 Ops/sec
HTML Preparation code:
x
 
1
<script src="https://blissfuljs.com/bliss.shy.min.js"></script>
2
<script src="https://zeptojs.com/zepto.min.js"></script>
3
<script src="https://cdn.jsdelivr.net/npm/umbrellajs"></script>
4
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.slim.min.js"></script>
5
6
<div id="custom-id">
7
  Lorem ipsum dolor sit amet,sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
8
  At vero eos et accusam et justo duo dolores et ea rebum.  Lorem ipsum dolor sit amet,  no sea takimata sanctus
9
  est Lorem ipsum dolor sit amet.  Stet clita kasd gubergren,  no sea takimata sanctus est Lorem ipsum dolor sit
10
  amet.  no sea takimata sanctus est Lorem ipsum dolor sit amet.  no sea takimata sanctus est Lorem ipsum dolor
11
  sit amet.  sed diam voluptua.  
12
</div>
Tests:
  • Vanilla Get ID

     
    var text = document.getElementById("custom-id");
  • Vanilla Get Text

     
    var text = document.getElementById("custom-id").textContent;
  • Vanilla Get Html

     
    var text = document.getElementById("custom-id").innerHTML;
  • jQuery Get ID

     
    var text = jQuery("#custom-id");
  • jQuery Get Text

     
    var text = jQuery("#custom-id").text();
  • jQuery Get Html

     
    var text = jQuery("#custom-id").html();
  • Zepto Get ID

     
    var text = Zepto("#custom-id");
  • Zepto Get Text

     
    var text = Zepto("#custom-id").text();
  • Zepto Get Html

     
    var text = Zepto("#custom-id").html();
  • Bliss Get ID

     
    var text = Bliss("#custom-id");
  • Bliss Get Text

     
    var text = Bliss("#custom-id").textContent;
  • Bliss Get Html

     
    var text = Bliss("#custom-id").textContent;
  • Umbrella Get ID

     
    var text = u("#custom-id");
  • Umbrella Get Text

     
    var text = u("#custom-id").text();
  • Umbrella Get HTML

     
    var text = u("#custom-id").html();