Make it faster to serialize layer attribute changes

RESOLVED FIXED in Firefox 54

Status

()

Core
Graphics: Layers
RESOLVED FIXED
11 months ago
11 months ago

People

(Reporter: dvander, Assigned: dvander)

Tracking

unspecified
mozilla54
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox54 fixed)

Details

Attachments

(6 attachments)

(Assignee)

Description

11 months ago
It's slow to serialize CommonLayerAttributes when there are many layers. We can improve it by grouping trivially serializable attributes together. The more types of fields we can group together like this, the easier it will be to eliminate expensive deserialization on the compositor side as well.
(Assignee)

Comment 1

11 months ago
Created attachment 8828681 [details] [diff] [review]
part 1, move ScrollDirection

Move ScrollDirection LayersTypes.h and give it a proper enum class type.
Attachment #8828681 - Flags: review?(bugmail)
(Assignee)

Comment 2

11 months ago
Created attachment 8828682 [details] [diff] [review]
part 2, don't use TransformMatrix

No reason to use this union wrapper in CommonLayerAttributes.
Attachment #8828682 - Flags: review?(matt.woodrow)
(Assignee)

Comment 3

11 months ago
Created attachment 8828683 [details] [diff] [review]
part 3, lump Paint operations separately

This lets us easily serialize stuff between Edits and Paints, which must come last.
Attachment #8828683 - Flags: review?(matt.woodrow)
(Assignee)

Comment 4

11 months ago
Created attachment 8828684 [details] [diff] [review]
part 4, lump OpSetLayerAttributes separately

This splits OpSetLayerAttributes out of Edit. Since it's a huge struct, this will reduce the amount of memory traffic needed when building the transaction message.
Attachment #8828684 - Flags: review?(matt.woodrow)
(Assignee)

Comment 5

11 months ago
Created attachment 8828685 [details] [diff] [review]
part 5, factor out plain-old-data attributes

This moves plain-old-data attributes into a SimpleLayerAttributes class, with the goal that it can just be memcpy'd rather than serialized field-by-field.
Attachment #8828685 - Flags: review?(matt.woodrow)
(Assignee)

Updated

11 months ago
Attachment #8828685 - Attachment description: part 5, factor our plain-old-data attributes → part 5, factor out plain-old-data attributes
(Assignee)

Comment 6

11 months ago
Created attachment 8828686 [details] [diff] [review]
part 6, send simple attributes separately
Attachment #8828686 - Flags: review?(matt.woodrow)
Attachment #8828681 - Flags: review?(bugmail) → review+
Attachment #8828682 - Flags: review?(matt.woodrow) → review+
Attachment #8828683 - Flags: review?(matt.woodrow) → review+
Attachment #8828684 - Flags: review?(matt.woodrow) → review+
Attachment #8828685 - Flags: review?(matt.woodrow) → review+
Attachment #8828686 - Flags: review?(matt.woodrow) → review+

Comment 7

11 months ago
Pushed by danderson@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/91bff1c46801
Move ScrollDirection to LayersTypes.h and make it a proper enum. (bug 1332567 part 1, r=kats)
https://hg.mozilla.org/integration/mozilla-inbound/rev/e9befbf971c2
Don't use TransformMatrix in CommonLayerAttributes. (bug 1332567 part 2, r=mattwoodrow)
https://hg.mozilla.org/integration/mozilla-inbound/rev/3a4b81fa3f07
Lump Paint operations separately from Edit operations. (bug 1332567 part 3, r=mattwoodrow)
https://hg.mozilla.org/integration/mozilla-inbound/rev/485841a2f637
Move OpSetLayerAttributes out of the Edit vector. (bug 1332567 part 4, r=mattwoodrow)
https://hg.mozilla.org/integration/mozilla-inbound/rev/810b96fdc671
Factor POD attributes of Layers into a SimpleLayerAttributes class. (bug 1332567 part 5, r=mattwoodrow)
https://hg.mozilla.org/integration/mozilla-inbound/rev/44f9535628fd
Send SimpleLayerAttributes separately from CommonLayerAttributes. (bug 1332567 part 6, r=mattwoodrow)

Comment 8

11 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/91bff1c46801
https://hg.mozilla.org/mozilla-central/rev/e9befbf971c2
https://hg.mozilla.org/mozilla-central/rev/3a4b81fa3f07
https://hg.mozilla.org/mozilla-central/rev/485841a2f637
https://hg.mozilla.org/mozilla-central/rev/810b96fdc671
https://hg.mozilla.org/mozilla-central/rev/44f9535628fd
Status: ASSIGNED → RESOLVED
Last Resolved: 11 months ago
status-firefox54: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
Depends on: 1334715

Updated

11 months ago
Depends on: 1334801
You need to log in before you can comment on or make changes to this bug.