Open Bug 1365476 Opened 6 years ago Updated 8 months ago

stylo: class handling during restyle hint computation may be suboptimal

Categories

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

53 Branch
enhancement

Tracking

()

Tracking Status
firefox57 --- wontfix

People

(Reporter: bzbarsky, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: perf)

In compute_hint (over in restyle_hints.rs) we do this:

  snapshot.each_class(|c| if !el.has_class(c) { additional_classes.push(c.clone()) });

The each_class call only does a single FFI call to get the list of classes in the snapshot.  But then for each one we do an FFI call that gets the class attr for the element, etc.  If we have multiple classes, this is a bunch more calls than we really need to do, I suspect.  It might be better to just get both lists once and then compare them directly without more FFI traffic.
Keywords: perf
Blocks: stylo-perf
Priority: -- → P4
status-firefox57=wontfix unless someone thinks this bug should block 57
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.