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 |
<script src="https://blissfuljs.com/bliss.shy.min.js"></script>
<script src="https://zeptojs.com/zepto.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/umbrellajs"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.slim.min.js"></script>
<div id="custom-id">
Lorem ipsum dolor sit amet,sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
At vero eos et accusam et justo duo dolores et ea rebum. Lorem ipsum dolor sit amet, no sea takimata sanctus
est Lorem ipsum dolor sit amet. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit
amet. no sea takimata sanctus est Lorem ipsum dolor sit amet. no sea takimata sanctus est Lorem ipsum dolor
sit amet. sed diam voluptua.
</div>
var text = document.getElementById("custom-id");
var text = document.getElementById("custom-id").textContent;
var text = document.getElementById("custom-id").innerHTML;
var text = jQuery("#custom-id");
var text = jQuery("#custom-id").text();
var text = jQuery("#custom-id").html();
var text = Zepto("#custom-id");
var text = Zepto("#custom-id").text();
var text = Zepto("#custom-id").html();
var text = Bliss("#custom-id");
var text = Bliss("#custom-id").textContent;
var text = Bliss("#custom-id").textContent;
var text = u("#custom-id");
var text = u("#custom-id").text();
var text = u("#custom-id").html();