L. David Baron wrote:
(b) revalidate the style sheet with the Necko cache and only re-use it if the Necko cache says it's still the same. I'm not sure how easy it would be to do (b).
Not that easy as things stand; imagelib has a cumbersome setup for this. We should make it easier by changing necko things, imo.
(3) Share the rule tree between documents, and attach the root of the rule tree (and half the stuff in nsStyleSet, which would need to be split into two classes) to the object created in step (2). (4) Share style contexts between documents by making the half of nsStyleSet that we created in step (3) do the equivalent of FindChildWithRules for the root style context. (And potentially make FindChildWithRules itself more accurate by using a hash table when the child count gets high, just like we do for rule nodes.) (5) Actually cache style contexts on XUL prototype documents so that we don't have to rerun selector matching when opening new windows. This depends on (3).
Presumably we'd also change the arena we allocate all this stuff out of, right?
Step (1) will reduce memory footprint and time spent parsing CSS when using multiple pages on the same site or multiple XUL documents using the same style sheets (or do we already have some optimizations here that I'm forgetting?)
The XUL prototype cache caches parsed chrome sheets, but other than that, no.
Any thoughts on these ideas and whether they'd be practical or useful?
I'm not sure how much mileage we could get out of step 5, but the rest of it seems like it could be pretty useful....
-Boris _______________________________________________ dev-tech-layout mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-layout

