User:Jdm/SlowCSSSelectors: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(Created page with "https://developer.mozilla.org/en/Writing_Efficient_CSS http://mxr.mozilla.org/mozilla-central/source/layout/style/nsCSSRuleProcessor.cpp http://mxr.mozilla.org/mozilla-central/so...")
 
No edit summary
Line 1: Line 1:
https://developer.mozilla.org/en/Writing_Efficient_CSS
https://developer.mozilla.org/en/Writing_Efficient_CSS
http://mxr.mozilla.org/mozilla-central/source/layout/style/nsCSSRuleProcessor.cpp
http://mxr.mozilla.org/mozilla-central/source/layout/style/nsCSSRuleProcessor.cpp
http://mxr.mozilla.org/mozilla-central/source/layout/style/nsCSSRuleProcessor.h
http://mxr.mozilla.org/mozilla-central/source/layout/style/nsCSSRuleProcessor.h
http://mxr.mozilla.org/mozilla-central/source/layout/style/StyleRule.h
http://mxr.mozilla.org/mozilla-central/source/layout/style/StyleRule.h
http://mxr.mozilla.org/mozilla-central/source/layout/style/StyleRule.cpp
http://mxr.mozilla.org/mozilla-central/source/layout/style/StyleRule.cpp
http://mxr.mozilla.org/mozilla-central/source/layout/style/nsNthIndexCache.cpp
http://mxr.mozilla.org/mozilla-central/source/layout/style/nsNthIndexCache.cpp
http://mxr.mozilla.org/mozilla-central/source/layout/style/nsNthIndexCache.h
http://mxr.mozilla.org/mozilla-central/source/layout/style/nsNthIndexCache.h


Functions like SelectorMatches show up in C++ profiles when CSS selector matching is being a problem. However, that is too low level - individual calls of SelectorMatches are fast, but the sheer volume of calls causes the problem.  Instead, RuleHash is used to avoid even looking at most selectors.
Functions like SelectorMatches show up in C++ profiles when CSS selector matching is being a problem. However, that is too low level - individual calls of SelectorMatches are fast, but the sheer volume of calls causes the problem.  Instead, RuleHash is used to avoid even looking at most selectors.

Revision as of 22:45, 13 March 2012