Open Bug 1938784 Opened 2 months ago Updated 2 months ago

[meta] Stylo compile times

Categories

(Core :: CSS Parsing and Computation, enhancement)

enhancement

Tracking

()

People

(Reporter: nico, Unassigned)

Details

(Keywords: meta)

Stylo is slow to compile! It can take 30+ seconds (Apple M1 Pro under load from also compiling other code). Let's see if we can make it faster.

Notes

  • Due to building as a single crate, the style crate's compilation is poorly parallelised. Other large crates can take as long to compile in total but are parallelised over 10 cores so ends up having a much smaller impact on overall compile time.
  • The style crate spends an unusually high proportion of time in the compiler frontend. I suspect this may be due to the large size of the crate, and some rustc codepaths having non-linear time complexity with respect to the size of a crate.

Ideas

  • Split "support code" into their own crate (e.g. gecko_bindings shouldn't depend on style)
  • Split values/properties modules into crates by related property (e.g. "core numeric types" (e.g. Length, LengthPercentage, etc), one for "color types", one for "flexbox types", one for "css grid types") which can then compile in parallel / pipelined.
You need to log in before you can comment on or make changes to this bug.