Run details:
Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36 Edg/91.0.864.70
Chrome 91
Windows 7
Desktop
3 years ago
Test name Executions per second
Vanilla Get ID 2463662.8 Ops/sec
Vanilla Get Text 2007372.6 Ops/sec
Vanilla Get Html 1803585.1 Ops/sec
Cash Get ID 1616629.0 Ops/sec
Cash Get Text 1381606.1 Ops/sec
Cash Get Html 1267125.5 Ops/sec
Bliss Get ID 1071698.4 Ops/sec
Bliss Get Text 948357.8 Ops/sec
jQuery Get ID 1406843.4 Ops/sec
jQuery Get Text 981328.9 Ops/sec
jQuery Get Html 1134638.9 Ops/sec
HTML Preparation code:
AخA
 
1
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"><script>
2
<script>
3
  jQuery.noConflict();  
4
</script>
5
<script src="https://cdnjs.cloudflare.com/ajax/libs/blissfuljs/1.0.6/bliss.min.js"></script>
6
<script src="https://cdnjs.cloudflare.com/ajax/libs/cash/8.1.0/cash.min.js"></script>
7
<div id="foo">Hello World</div>
Tests:
  • Vanilla Get ID

     
    var text = document.getElementById("foo");
  • Vanilla Get Text

     
    var text = document.getElementById("foo").textContent;
  • Vanilla Get Html

     
    var text = document.getElementById("foo").innerHTML;
  • Cash Get ID

     
    var text = $("#foo");
  • Cash Get Text

     
    var text = $("#foo").text();
  • Cash Get Html

     
    var text = $("#foo").html();
  • Bliss Get ID

     
    var text = Bliss("#foo");
  • Bliss Get Text

     
    var text = Bliss("#foo").textContent;
  • jQuery Get ID

     
    var text = jQuery("#foo");
  • jQuery Get Text

     
    var text = jQuery("#foo").text();
  • jQuery Get Html

     
    var text = jQuery("#foo").html();