html.css is parsed in every new process |
||||||
Issue descriptionLooking at traces of pages loads, I see ~20ms (on my workstation) of time on main thread spent parsing a style sheet before anything is loaded. It seems this is html.css which doesn't vary from page to page so presumably could be parsed once and the parsed structure copied, saving some (as yet unknown) amount of time on each load. There is a second parse of a 3.5k sheet that occurs too, not sure yet which sheet this is. There are also some RuleSet::addRulesFromSheet that follow. It's possible we could start by copying the initial RuleSet with the first sheet parsed as step one.
,
Nov 6
There's always a possibility to have UA stylesheets in a format that's faster to instantiate. I thought we had an open issue for that somewhere, but I'm not able to find it now. Fergal, are you seeing new instances of rendering processes loading the html.css, or do you have a repro that shows re-parsing within the same process?
,
Nov 6
I'll confirm but I thought I saw it all the time. That could have bee because I was clearing cache for repro purposes but I imagine site isolation would also impact this.
,
Nov 9
Looking at traces, it seems that each new process does only parse it once however loading (presumably with site isolation) www.cnn.com starts 7 processes. I can also confirm that navigating from cnn to facebook and back again causes a reparse. It's hard to know exactly what impact is but it definitely seems like fixing this could be worth some effort. Unclear how much. I assume that this is going to suffer from the existing AtomicString cannot be used cross-thread which is going to make it hard to simply copy a data structure from a central copy.
,
Nov 9
,
Nov 9
> I assume that this is going to suffer from the existing AtomicString cannot be used cross-thread which is going to make it hard to simply copy a data structure from a central copy. This is not only cross-thread, it's cross-process. I think creating some pre-parsed format at compile time that is a lot faster to load could be an option.
,
Jan 11
,
Jan 14
|
||||||
►
Sign in to add a comment |
||||||
Comment 1 by futhark@chromium.org
, Nov 6