Closed
Bug 1162725
Opened 9 years ago
Closed 9 years ago
Make .th-content "flex:1" instead of "flex:auto"
Categories
(Tree Management :: Treeherder, defect, P2)
Tree Management
Treeherder
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: dholbert, Assigned: wlach)
References
(Blocks 1 open bug)
Details
(Keywords: perf)
Attachments
(1 file)
Right now, .th-content has "flex:auto", which means we have to reflow it twice (as discussed in bug 1159819 comment 1).
We don't really care about its auto-size, though, because it's scrollable. So we should just make it "flex:1" so that it absorbs free space without needing to bother measuring its auto-height.
This gives us a decent speedup, per bug 1159819 comment 2.
Reporter | ||
Comment 1•9 years ago
|
||
wlach, perhaps you take this, or farm it out to someone? (One-liner change, should be pretty easy.)
Reporter | ||
Updated•9 years ago
|
Flags: needinfo?(wlachance)
Assignee | ||
Comment 2•9 years ago
|
||
Let's just fix this, since it's so simple and sheriffs have been asking for a more responsive UI.
More just asking for a rubber stamp here, the details are kind of opaque to me but I can confirm this improves the speed of loading 50 results.
Assignee: nobody → wlachance
Flags: needinfo?(wlachance)
Attachment #8603021 -
Flags: review?(emorley)
Comment 3•9 years ago
|
||
Comment on attachment 8603021 [details] [review]
Use flex: 1 with treeherder content
\o/ :-D
Attachment #8603021 -
Flags: review?(emorley) → review+
Updated•9 years ago
|
Comment 4•9 years ago
|
||
Commit pushed to master at https://github.com/mozilla/treeherder-ui
https://github.com/mozilla/treeherder-ui/commit/4972b6c5021080c662dd9e158d1b09cdb2cbb193
Bug 1162725 - Use flex: 1 with treeherder content
Prevents unnecessary reflows
Assignee | ||
Updated•9 years ago
|
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 5•9 years ago
|
||
(In reply to William Lachance (:wlach) from comment #2)
> More just asking for a rubber stamp here, the details are kind of opaque to
> me but I can confirm this improves the speed of loading 50 results.
If it clarifies things:
* "flex:auto;" (combined with "width|height:auto") means "start me at my auto-size, and then cooperatively grow/shrink from there to fill the container".
* "flex:1" means "start me at 0, and then grow/shrink from there to fill the container"
These produce different results if there are multiple flexible items.
But if there's only one flexible thing (as is the case here), they effectively mean the same thing. th-content will always get all of the extra space, no matter where we start it flexing from, since it's the only thing that can eat up free space.
So, the styles are equivalent. And the first is less efficient, since it asks that we measure the auto-height of th-content before we do any flexing. (The second just lets us start at 0 and not bother with the measuring.)
(It's possible we could add an optimization in Gecko to catch this case and skip measurement-that-will-prove-unnecessary.)
Reporter | ||
Comment 6•9 years ago
|
||
(In reply to Daniel Holbert [:dholbert] from comment #5)
> (It's possible we could add an optimization in Gecko to catch this case and
> skip measurement-that-will-prove-unnecessary.)
(I filed bug 1162786 with some more details on this possible optimization, btw.)
Comment 7•9 years ago
|
||
Commit pushed to master at https://github.com/mozilla/treeherder
https://github.com/mozilla/treeherder/commit/e5cc40874bca4d2b98b89b263660199ee5fa9314
Bug 1162725 - Use flex: 1 with treeherder content
Prevents unnecessary reflows
You need to log in
before you can comment on or make changes to this bug.
Description
•