[whatwg] Stat. on frequency of node insertion without children
rniwa at webkit.org
Fri Dec 2 23:24:47 PST 2011
Several days ago, we had a discussion about improving DOM performance on
#whatwg where I hypothesized that most of nodes inserted by methods like
insertBefore, appendChild, etc... don't have any children, and therefore we
can bypass checks for HIERARCHY_REQUEST_ERR by just checking the nullity of
To confirm my hypothesis, I made a custom build of WebKit and collected
statistics, and here's the result. The sample size is 3585 DOM API calls
while browsing facebook, twitter, gmail, google+, and webkit's bugzilla.
<number of nodes inserted per DOM API call> <percentage>
i.e. 52.9% of all inserted nodes don't have any children.
More information about the whatwg