Open Bug 1478953 Opened 6 years ago Updated 2 years ago

style.foo = bar changes are slow

Categories

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

enhancement

Tracking

()

Performance Impact medium

People

(Reporter: smaug, Unassigned)

References

Details

(Keywords: perf:responsiveness)

Attachments

(1 file)

A testcase I've used for profiling is
https://bugzilla.mozilla.org/attachment.cgi?id=8983177
"withoutmutationobserver" part is perhaps the most valid part for this bug.

this is with
export RUSTC_OPT_LEVEL=2

Mostly stylo but also some DOM attribute handling
Color is a bit more annoying than the rest of the properties... But yeah, there are improvements that could be made there.
Priority: -- → P3
Whiteboard: [qf]
Whiteboard: [qf] → [qf:p3:f67]
Attached file style.top
Another test.

On Linux 35% slower than Chrome.
So parsing stuff and attribute setting is 5-10% of MotionMark.
This should probably be qf:p1.
Whiteboard: [qf:p3:f67] → [qf:p1:f67]

smaug and/or emilio: from a [qf] categorization perspective, do you know whether this bug's use cases fall into pageload vs. responsiveness? (Or something else?)

(Intuitively it seems like "style.foo = bar" is primarily an after-page-load scenario, in response to interaction, though of course it could also be performed in an onload handler.)

Flags: needinfo?(bugs)

I haven't seen this badly during pageload.

Flags: needinfo?(bugs)
Whiteboard: [qf:p1:f67] → [qf:p2:responsiveness]

https://perfht.ml/2TS0BUD

I guess stylo should do something faster. set_property looks particularly hot.

Performance Impact: --- → P2
Whiteboard: [qf:p2:responsiveness]
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: