[Webkit-unassigned] [Bug 97270] DOM-in-JavaScript performance experiments

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Sep 26 14:21:11 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=97270





--- Comment #13 from Adam Barth <abarth at webkit.org>  2012-09-26 14:21:37 PST ---
> Adam, I am intrigued by the possibility of 30% speedups.

Me too!  I should warn you that these are just experiments.  There isn't a real design here.  Just some evidence that we might want to look into moving move of the DOM into JavaScript.

> How do I interpret the results of the patched Dromaeo/dom-traverse? I get output like this, how do I interpret it? Which are the C++ DOM numbers and which are the JS DOM numbers?

If you look in the dom-traverse patch, you'll see the following two lines:

+ document.body.cppFirstChild = document.body.firstChild;
+ document.body.jsFirstChild = mirror(document.body.firstChild);

What this means is that document.body.cppFirstChild points to the normal implementation of the DOM: namely backed by CPP code in WebCore.  On the other hand, document.body.jsFirstChild is a JavaScript-only mirror of the DOM structure, created just by wiring up firstChild/lastChild/nextSibling/previousSibling properties up on empty JavaScript objects.  (I haven't tested the mirror function, so it might have bugs.)

If you look in the nextSibling test, you'll see the following line of code:

+ var cur = document.body.jsFirstChild; // Change to document.body.cppFirstChild

That means the test is running with the JavaScript version of the DOM tree.  If you change jsFirstChild to cppFirstChild, you'll be running with the CPP version of the DOM tree.  You can run test once with jsFirstChild and once with cppFirstChild to compare the performance differences between the two implementations of the tree.

The way I've been doing that with with the run-perf-tests script, which creates nice graphs for comparing the output:

$ ./Tools/Scripts/run-perf-tests PerformanceTests/Dromaeo/dom-traverse.html

You can also just compare the avg runs/s numerically.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list