Closed Bug 1618678 Opened 5 years ago Closed 5 years ago

geckoservo::glue::traverse_subtree was slower in Fenix compare to Fennec

Categories

(Core :: CSS Parsing and Computation, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla76
Tracking Status
firefox76 --- fixed

People

(Reporter: sefeng211, Assigned: emilio)

References

Details

Attachments

(3 files)

Fennec: https://perfht.ml/2TpGIpH
Fenix: https://perfht.ml/2Pv9h3w

Phone: Moto G5.

The profile was taken by loading https://stackoverflow.com/questions/927358/how-do-i-undo-the-most-recent-commits-in-git.

Based on the profile, Fennec was 20ms and Fenix took 100ms. And there's another call path in Fenix profile, which also took 30ms.

I'm a bit confused by that callstack as it's only showing the StyleSubtree calls that appear under the frame constructor, which are usually just for native anonymous content and such.

These are probably scrollbar styles.

We added a caching mechanism for them in bug 1554571, but that also included a bunch of exit conditions and extra rules. So the individual StyleSubtree calls are expected to be more expensive, but we should not have many of them.

That being said, give Geckoview has their own CSS for scrollbars, it may be that they're not hitting the optimized path.

At a glance, this:

Seems like it'd conflict with this:

So we would be doing much more expensive styling of all the scrollbar thumbs and such. Does commenting out the scrollbar-related rules in geckoview.css help with this? Can you check whether you're hitting the allowStyleCaching=false?

Alternative approach of verifying that hypotheses:

  • Turn layout.css.cached-scrollbar-styles.enabled to false
  • Remove this rule
  • Are the times the closer to the fennec ones?

NI myself for verifying the hypotheses.

Blocks: 1604930
Flags: needinfo?(sefeng)
Blocks: 1602510
Priority: -- → P3

Hi Emilio,

I tried the #comment 2 approach and it improved it a lot. Looking at the profiles, without change https://perfht.ml/2VMV1aB and with change https://perfht.ml/38wnBzI , it cuts more than half the time!

Flags: needinfo?(sefeng)

Ok, that's great to know... I'll take a look at this next week.

Flags: needinfo?(emilio)
See Also: → 1620866
Assignee: nobody → emilio
Status: NEW → ASSIGNED

It seems very paranoid about stuff that can't happen.

Depends on D65916

Flags: needinfo?(emilio)
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a6b513d590d4 Make scrollbar style caching work on Android. r=heycam https://hg.mozilla.org/integration/autoland/rev/85020a807040 Make disabling layout.css.cached-scrollbar-styles.enabled not a massive perf regression. r=heycam https://hg.mozilla.org/integration/autoland/rev/bbcf0278b31d Simplify a bit GeckoView's scrollbars.css. r=heycam
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla76
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: