-
Notifications
You must be signed in to change notification settings - Fork 48
Open
Description
If an epub's stylesheets contain a lot of class selectors (which is not rare) then current code can be terribly slow. Basically if there are m class selectors and n nodes, more than mn calls to LVCssSelectorRule::check() are made. Some optimization ideas:
- Hash class selectors (maybe also ID selectors) in the stylesheet. Given current
classattr, we can skip most class selectors. Can be constructed duringLVStyleSheet.push()? - Cache various
getAttributeValue()results inLVStyleSheet::apply(), so we don't repeatedly call that on the same node against different rules. ldomNodetrades speed for space. On x64 there are 4 bytes padding that can be utilized, such as storing node ID. May be irrelevant if previous 2 items are implemented.
I test epubs with LoadDocument() and Render(). I've noticed that styles are applied in both calls. Why so?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels