Closed ncannasse closed 2 years ago
rules_optimize branch is a bit better than first attempt. Reduces matches by 2-10 with not much book-keeping. But not enough to merge for now. Would require some generalization by taking parent RuleGroup into account to further reduce the number of rules.
There's a rule caching mechanism that was introduced in 366bd6760d786b764f72222ac5f0df07560c7971
Currently we check all CSS rules for each object. It's very fast but it doesn't scale with huge CSS files.
I tried implementing the following approach : filter top rules by (component+id) but it didn't work out very well. Reduces checks by only about 30%, because
I guess we might need a more top-down approach were we reconstruct the Rule tree then filter based on parent-contextual rules.