<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"><script>
<script>jQuery.noConflict();</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/cash/7.0.3/cash.min.js"></script>
<div id="foo" class="foo2"></div>
var el = document.getElementById("foo");
var className = el.className;
var el = document.getElementsByClassName("foo2");
var className = el.className;
var el = document.getElementsByTagName("div")[0];
var className = el.className;
var el = document.querySelector('#foo');
var className = el.className;
var el = document.querySelector('.foo2');
var className = el.className;
var el = document.querySelectorAll('#foo');
var className = el.className;
var el = document.querySelectorAll('.foo2');
var className = el.className;
var el = $("#foo");
var className = el.className;
var el = $(".foo2");
var className = el.className;
var el = $("div#foo");
var className = el.className;
var el = $("div.foo2");
var className = el.className;
var el = $(document.getElementById("foo"));
var className = el.className;
var el = $(document.getElementsByClassName("foo2"));
var className = el.className;
var el = jQuery("#foo");
var className = el.className;
var el = jQuery(".foo2");
var className = el.className;
var el = jQuery("div#foo");
var className = el.className;
var el = jQuery("div.foo2");
var className = el.className;
var el = jQuery(document.getElementById("foo"));
var className = el.className;
var el = jQuery(document.getElementsByClassName("foo2"));
var className = el.className;
--enable-precise-memory-info
flag.
Test case name | Result |
---|---|
getElementById | |
getElementsByClassName | |
getElementsByTagName | |
querySelector (#id) | |
querySelector (.id) | |
querySelectorAll (#id) | |
querySelectorAll (.id) | |
Cash (#id) | |
Cash (.id) | |
Cash (tag#id) | |
Cash (tag.id) | |
Cash + getElementById | |
Cash + getElementsByClassName | |
jQuery (#id) | |
jQuery (.id) | |
jQuery (tag#id) | |
jQuery (tag.id) | |
jQuery + getElementById | |
jQuery + getElementsByClassName |
Test name | Executions per second |
---|---|
getElementById | 11050676.0 Ops/sec |
jQuery (tag.id) | 1585707.1 Ops/sec |
jQuery (tag#id) | 1411618.5 Ops/sec |
jQuery (.id) | 2631563.0 Ops/sec |
jQuery (#id) | 4627566.0 Ops/sec |
Cash + getElementsByClassName | 2929756.2 Ops/sec |
Cash + getElementById | 4495168.0 Ops/sec |
Cash (tag.id) | 2309697.5 Ops/sec |
jQuery + getElementById | 5006050.5 Ops/sec |
Cash (tag#id) | 1932334.5 Ops/sec |
Cash (#id) | 5040011.5 Ops/sec |
querySelectorAll (.id) | 3045331.2 Ops/sec |
querySelectorAll (#id) | 2679043.5 Ops/sec |
querySelector (.id) | 6098783.5 Ops/sec |
querySelector (#id) | 4262768.5 Ops/sec |
getElementsByTagName | 8326466.5 Ops/sec |
getElementsByClassName | 6958161.5 Ops/sec |
Cash (.id) | 3034542.2 Ops/sec |
jQuery + getElementsByClassName | 1746162.6 Ops/sec |
It seems like you're sharing a JSON string representing test results from a browser execution tool, likely Selenium Grid or similar.
Here are the extracted and formatted results:
Test 1: Cash (.id)
Test 2: Cash + getElementsByClassName
Test 3: querySelectorAll (#id)
Test 4: jQuery (.id)
Test 5: Cash (tag.id)
Test 6: Cash (tag#id)
Test 7: jQuery + getElementsByClassName
Test 8: jQuery (tag.id)
Test 9: jQuery (tag#id)
Please let me know if you'd like to ask any specific questions about these test results or if there's anything else I can help with!