This upstreams http://code.google.com/p/chromium/issues/detail?id=155620 A profiling unveiled that this installPerContextProperties() is slower if the flag is on. It makes sense since it injects extra DOMWindow properties at runtime. My assumption is that installPerContextProperties() is called only a few times per page. But there are some outliers in page cycler suite which consume 1.3% time in this function for each page load. I'll make some micro-benchmark for this.
Basically there are two approaches to fix this. A. Stop using EnablePerContext: Considering Chromium make it available for the wild Web, The Shadow DOM feature does no longer need to be contextual. B. Make EnablePerContext faster somehow. I have no concrete idea yet. But maybe we should do this for other features which uses this contextual switch mechanism. My feeling is that we can land A first then attack B if possible.
(In reply to comment #1) > My feeling is that we can land A first then attack B if possible. That sounds good.
Created attachment 169079 [details] Patch
Created attachment 169085 [details] Patch for landing
Comment on attachment 169085 [details] Patch for landing Clearing flags on attachment: 169085 Committed r131549: <http://trac.webkit.org/changeset/131549>
All reviewed patches have been landed. Closing bug.