perf: improve baseline speed by 30%

Use node.firstChild and node.nextSibling instead 
of node.children or node.childNodes in the baseline
benchmark.
This commit is contained in:
Misko Hevery
2014-12-11 13:58:26 -08:00
parent 017f6ced4d
commit 56b7ba4bce
4 changed files with 19 additions and 10 deletions

View File

@ -38,6 +38,9 @@ class DOM {
static Node firstChild(el) {
return el.firstChild;
}
static Node nextSibling(el) {
return el.nextNode;
}
static Element parentElement(el) {
return el.parent;
}

View File

@ -31,6 +31,9 @@ export class DOM {
static firstChild(el):Node {
return el.firstChild;
}
static nextSibling(el):Node {
return el.nextSibling;
}
static parentElement(el) {
return el.parentElement;
}