<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>
<script src="https://cdn.jsdelivr.net/npm/umbrellajs"></script>
<div id="foo" class="foo2"></div>
var el = document.getElementById("foo");
var className = el.className;
var el = u("div.foo2");
var className = el.className;
var el = u("div#foo");
var className = el.className;
var el = u(".foo2");
var className = el.className;
var el = u("#foo");
var className = el.className;
var el = jQuery(document.getElementsByClassName("foo2"));
var className = el.className;
var el = jQuery(document.getElementById("foo"));
var className = el.className;
var el = jQuery("div.foo2");
var className = el.className;
var el = jQuery("div#foo");
var className = el.className;
var el = jQuery(".foo2");
var className = el.className;
var el = jQuery("#foo");
var className = el.className;
var el = u(document.getElementById("foo"));
var className = el.className;
var el = $(document.getElementsByClassName("foo2"));
var className = el.className;
var el = $("div.foo2");
var className = el.className;
var el = $("div#foo");
var className = el.className;
var el = $(".foo2");
var className = el.className;
var el = $("#foo");
var className = el.className;
var el = document.querySelectorAll('.foo2');
var className = el.className;
var el = document.querySelectorAll('#foo');
var className = el.className;
var el = document.querySelector('.foo2');
var className = el.className;
var el = document.querySelector('#foo');
var className = el.className;
var el = document.getElementsByTagName("div")[0];
var className = el.className;
var el = document.getElementsByClassName("foo2");
var className = el.className;
var el = $(document.getElementById("foo"));
var className = el.className;
var el = u(document.getElementsByClassName("foo2"));
var className = el.className;
--enable-precise-memory-info
flag.
Test case name | Result |
---|---|
getElementById | |
Umbrella(tag.id) | |
Umbrella(tag#id) | |
Umbrella(.id) | |
Umbrella(#id) | |
jQuery + getElementsByClassName | |
jQuery + getElementById | |
jQuery (tag.id) | |
jQuery (tag#id) | |
jQuery (.id) | |
jQuery (#id) | |
Umbrella + getElementById | |
Cash + getElementsByClassName | |
Cash (tag.id) | |
Cash (tag#id) | |
Cash (.id) | |
Cash (#id) | |
querySelectorAll (.id) | |
querySelectorAll (#id) | |
querySelector (.id) | |
querySelector (#id) | |
getElementsByTagName | |
getElementsByClassName | |
Cash + getElementById | |
Umbrella + getElementsByClassName |
Test name | Executions per second |
---|---|
getElementById | 5921505.0 Ops/sec |
Umbrella(tag.id) | 659797.1 Ops/sec |
Umbrella(tag#id) | 617042.3 Ops/sec |
Umbrella(.id) | 656626.9 Ops/sec |
Umbrella(#id) | 644504.4 Ops/sec |
jQuery + getElementsByClassName | 1286030.8 Ops/sec |
jQuery + getElementById | 4125965.8 Ops/sec |
jQuery (tag.id) | 962611.7 Ops/sec |
jQuery (tag#id) | 945863.2 Ops/sec |
jQuery (.id) | 1985559.5 Ops/sec |
jQuery (#id) | 7407952.5 Ops/sec |
Umbrella + getElementById | 1186384.8 Ops/sec |
Cash + getElementsByClassName | 2517597.5 Ops/sec |
Cash (tag.id) | 1293283.9 Ops/sec |
Cash (tag#id) | 1204281.9 Ops/sec |
Cash (.id) | 2809035.5 Ops/sec |
Cash (#id) | 7760837.0 Ops/sec |
querySelectorAll (.id) | 1545229.5 Ops/sec |
querySelectorAll (#id) | 1408590.6 Ops/sec |
querySelector (.id) | 3549211.2 Ops/sec |
querySelector (#id) | 3579967.0 Ops/sec |
getElementsByTagName | 4813066.5 Ops/sec |
getElementsByClassName | 3164335.8 Ops/sec |
Cash + getElementById | 3873927.0 Ops/sec |
Umbrella + getElementsByClassName | 939420.4 Ops/sec |
It looks like you're sharing a JSON array of user agent data. I'll help you parse it.
Here's the data in a readable format:
User Agent Data
Which specific data are you interested in?