Last Comment Bug 689968 - CssLogic is slow at skipping UA rules for the unmatched selectors view
: CssLogic is slow at skipping UA rules for the unmatched selectors view
Product: Firefox
Classification: Client Software
Component: Developer Tools (show other bugs)
: Trunk
: All All
: -- normal (vote)
: Firefox 10
Assigned To: Mihai Sucan [:msucan]
: J. Ryan Stinnett [:jryans] (use ni?)
Depends on:
  Show dependency treegraph
Reported: 2011-09-28 09:21 PDT by Mihai Sucan [:msucan]
Modified: 2011-10-04 05:18 PDT (History)
2 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

proposed fix (3.34 KB, patch)
2011-09-28 09:33 PDT, Mihai Sucan [:msucan]
rcampbell: review+
Details | Diff | Splinter Review

Description Mihai Sucan [:msucan] 2011-09-28 09:21:34 PDT
CssLogic skips on a selector-by-selector basis those rules that come from UA style sheets, when building the array of unmatched selectors.

(note that a sheet has multiple rules, and each rule has multiple selectors!)

We need to skip UA sheets entirely from being processed when building the array of unmatched selectors. This will improve performance in all of the Style Inspector use cases, irrespective of the "Show only user styles" checkbox state.
Comment 1 Mihai Sucan [:msucan] 2011-09-28 09:33:15 PDT
Created attachment 563092 [details] [diff] [review]
proposed fix

This patch changes the location of where the system rules are skipped.

It seems that system rules have been skipped inside the CssPropertyInfo code path. It should be quite faster to skip the system style sheets entirely in the CssLogic code path, so they never get processed.

(I don't know when the change was made for systemRules to be skipped in the unmatched selectors view...)

All tests pass on my system.
Comment 2 Rob Campbell [:rc] (:robcee) 2011-09-28 13:02:02 PDT
Comment on attachment 563092 [details] [diff] [review]
proposed fix

Comment 3 Mihai Sucan [:msucan] 2011-09-28 13:16:36 PDT
Thank you Rob!
Comment 4 Rob Campbell [:rc] (:robcee) 2011-09-29 06:31:45 PDT
Comment 5 Rob Campbell [:rc] (:robcee) 2011-10-04 05:18:16 PDT

Note You need to log in before you can comment on or make changes to this bug.