<html>
<body>
<div id='test'>
<div class='item' id='a' name='a'>a</div>
<div class='item' id='b' name='b'>b</div>
<div class='item' id='c' name='c'>c</div>
</div>
</body>
</html>
var parent = document.getElementById('test');
var store1 = [];
var store2 = [];
parent.childNodes.forEach(function (node) {
if ( node.nodeName !== '#text') {
store1.push( node );
store2.push( { name: node.attributes.name.value } );
}
});
for (let i = store2.length-1; i >= 0; i--) {
let n = store2[i].name;
console.log("R",n)
}
let elem = parent.firstElementChild;
do {
let n = elem.attributes.name.value;
} while (elem = elem.nextElementSibling)
let children = parent.getElementsByTagName('div');
for (let i = 0; i < children.length; i++) {
let n = children[i].attributes.name.value;
}
let children = parent.getElementsByClassName('item')
for (let i = 0; i < children.length; i++) {
let n = children[i].attributes.name.value;
}
let n1 = document.getElementById('a').attributes.name.value;
let n2 = document.getElementById('b').attributes.name.value;
let n3 = document.getElementById('c').attributes.name.value;
for (let i = 0; i < store1.length; i++) {
let n = store1[i].attributes.name.value;
}
for (let i = 0; i < store2.length; i++) {
let n = store2[i].name;
}
let elem = parent.firstElementChild;
do {
let n = elem.getAttribute('name');
} while (elem = elem.nextElementSibling)
let elem = parent.firstElementChild;
do {
let n = elem.nodeValue;
} while (elem = elem.nextElementSibling)
let elem = parent.firstElementChild;
do {
let n = elem.textContent;
} while (elem = elem.nextElementSibling)
let elem = parent.firstElementChild;
do {
let n = elem.getAttributeNode('name').value;
} while (elem = elem.nextElementSibling)
let children = parent.getElementsByTagName('div');
for (let i = children.length-1; i >= 0; i--) {
let n = children[i].attributes.name.value;
}
let children = parent.getElementsByClassName('item')
for (let i = children.length-1; i >= 0; i--) {
let n = children[i].attributes.name.value;
}
let children = parent.querySelectorAll('.item')
for (let i = children.length-1; i >= 0; i--) {
let n = children[i].attributes.name.value;
}
let children = parent.querySelectorAll('div')
for (let i = children.length-1; i >= 0; i--) {
let n = children[i].attributes.name.value;
}
for (let i = store2.length-1; i >= 0; i--) {
let n = store2[i].name;
}
--enable-precise-memory-info
flag.
Test case name | Result |
---|---|
fastest iter childelements | |
tag name | |
class name | |
id | |
array of node | |
array item | |
fastest iter childelements + getAttribute | |
fastest iter childelements + nodeValue | |
fastest iter childelements + textContent | |
fastest iter childelements + getAttributeNode | |
tag name-- | |
class name-- | |
queryselectorall class-- | |
queryselectorall tag-- | |
array item-- |
Test name | Executions per second |
---|---|
fastest iter childelements | 1829338.2 Ops/sec |
tag name | 1477045.5 Ops/sec |
class name | 1466709.4 Ops/sec |
id | 1072931.6 Ops/sec |
array of node | 2026058.9 Ops/sec |
array item | 200652032.0 Ops/sec |
fastest iter childelements + getAttribute | 8877777.0 Ops/sec |
fastest iter childelements + nodeValue | 14239759.0 Ops/sec |
fastest iter childelements + textContent | 8403773.0 Ops/sec |
fastest iter childelements + getAttributeNode | 2757558.2 Ops/sec |
tag name-- | 1732371.9 Ops/sec |
class name-- | 1737964.9 Ops/sec |
queryselectorall class-- | 1146137.8 Ops/sec |
queryselectorall tag-- | 1117409.2 Ops/sec |
array item-- | 216271008.0 Ops/sec |
I'll dive straight into it.
The data appears to be a JSON string containing an array of objects, each representing a test run with various performance metrics for Firefox 110 on Linux desktop devices.
Here's a concise summary:
Browsers: Firefox 110 Platforms: Desktop (Linux) Operating Systems: Linux
Test Names:
Execution Metrics:
This data likely originates from performance benchmarking or testing of Firefox's DOM and event loop capabilities on Linux desktop devices.