Note: There are a few cases of duplicates in user autocompletion which are being worked on.

csshtmltree.refreshPanel should use a setTimeout loop to improve performance (cancel-able)

RESOLVED FIXED in Firefox 10

Status

()

Firefox
Developer Tools
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: miker, Assigned: miker)

Tracking

unspecified
Firefox 10
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [styleinspector][minotaur])

Attachments

(1 attachment, 5 obsolete attachments)

csshtmltree.refreshPanel should use a setTimeout loop to improve performance (cancel-able)
Whiteboard: [styleinspector]
Blocks: 685902
Assignee: nobody → mratcliffe
Status: NEW → ASSIGNED
Created attachment 561164 [details] [diff] [review]
setTimeout loop patch 1

Done
Attachment #561164 - Flags: review?(mihai.sucan)
I would prefer a UI fix that doesn't show the number of unmatched rules. That's the part that takes a ton of time to compute in CssLogic. That would speed things up far more.

Rob: what do you think?
Yes, but that is part of another bugfix ... Dave Camp asked for both.
He asked for this because it slows the breadcrumbs down a lot.
(In reply to Mihai Sucan [:msucan] from comment #2)
> I would prefer a UI fix that doesn't show the number of unmatched rules.
> That's the part that takes a ton of time to compute in CssLogic. That would
> speed things up far more.
> 
> Rob: what do you think?

yeah, I don't know about this. I'd like to know more about why we need it (to speed up breadcrumbs?) and what we could do differently in the Style Inspector to make that not a problem.
(In reply to Rob Campbell [:rc] (robcee) from comment #5)
> (In reply to Mihai Sucan [:msucan] from comment #2)
> > I would prefer a UI fix that doesn't show the number of unmatched rules.
> > That's the part that takes a ton of time to compute in CssLogic. That would
> > speed things up far more.
> > 
> > Rob: what do you think?
> 
> yeah, I don't know about this. I'd like to know more about why we need it
> (to speed up breadcrumbs?) and what we could do differently in the Style
> Inspector to make that not a problem.

There's work underway that will make these timeouts unneeded:

1. the style inspector UI update will remove the matched/unmatched selector counts, which are a major reason for the sluggishness (especially the unmatched count).

2. two new methods are going to be added to CssLogic: hasMatchedSelectors() and hasUnmatchedSelectors(). These will allow UI to change as needed, with a quick-bailout implementation that doesn't have to do all of the hard work done for retrieving counts or for displaying the list of selectors.

I'm quite positive that with these two fixes (Mike's working on them), we'll be able to remove all timers. If performance will continue to be a problem, then CssHtmlTree remains to be the source of negative perf impact - the UI code.
Comment on attachment 561164 [details] [diff] [review]
setTimeout loop patch 1

Review of attachment 561164 [details] [diff] [review]:
-----------------------------------------------------------------

The UI work and the has[un]MatchedSelectors() stuff will help quite more with the perceived tool perf.

My code comment is below.

::: browser/devtools/styleinspector/CssHtmlTree.jsm
@@ +247,2 @@
>      }
> +    this._panelRefreshTimeout = this.win.setTimeout(refreshView.bind(this), 0);

I would prefer us to keep this.propertyViews as an object that maps property names to their PropertyView instance. If I am not mistaken, here you can loop through the object using a generator and a for..in loop.
Attachment #561164 - Flags: review?(mihai.sucan)
Comment on attachment 561164 [details] [diff] [review]
setTimeout loop patch 1

Since we are going to keep this code (for now), I am giving the patch r+.
Attachment #561164 - Flags: review+
Whiteboard: [styleinspector] → [styleinspector][review+]
Created attachment 566794 [details] [diff] [review]
setTimeout loop patch 2

Fixed failing test
Attachment #561164 - Attachment is obsolete: true
Created attachment 566850 [details] [diff] [review]
setTimeout loop patch 3

Rebased
Attachment #566794 - Attachment is obsolete: true
Whiteboard: [styleinspector][review+] → [styleinspector][minotaur][review+]
Please update dependencies when they change.

Also, please do not write each patch you work on on top of the previous work. This causes us to get into really long patch queues. Please keep dependencies strictly on a technical requirement level. For example this patch does not technically require bug 691736.

(Anyhow, this suggestion should apply only for future patches, not for the existing patch queue. So, please don't apply my suggestion by decoupling the current Style Inspector patch queue :). Thank you!)
Depends on: 691736
Created attachment 567403 [details] [diff] [review]
setTimeout loop patch 4

Rebased
Attachment #566850 - Attachment is obsolete: true
Attachment #567403 - Flags: review?
Attachment #567403 - Flags: review?
Created attachment 567728 [details] [diff] [review]
setTimeout loop patch 5

Rebased
Attachment #567403 - Attachment is obsolete: true

Updated

6 years ago
No longer blocks: 685902
Created attachment 567996 [details] [diff] [review]
Add setTimeout loop 685900 patch 6

Removed dependencies as part of reordering patch queue
Attachment #567728 - Attachment is obsolete: true
Whiteboard: [styleinspector][minotaur][review+] → [styleinspector][minotaur][land-in-fx-team]
https://hg.mozilla.org/integration/fx-team/rev/a67521de22d5
Whiteboard: [styleinspector][minotaur][land-in-fx-team] → [styleinspector][minotaur][fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/a67521de22d5
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Whiteboard: [styleinspector][minotaur][fixed-in-fx-team] → [styleinspector][minotaur]
Target Milestone: --- → Firefox 10
You need to log in before you can comment on or make changes to this bug.