Skip to content

Improve incremental compile speed on webrender_api #59650

Closed
@nnethercote

Description

@nnethercote

This was originally filed as a rustc-perf issue, but I'm moving it here because it's really a rustc issue.

The workload in question:

cd webrender/webrender_api && cargo check && touch color.rs && cargo check

In rustc-perf parlance, that is a "CleanIncr" build.

The 5692 lines of rust code in webrender_api expand to 85511 with cargo expand, largely due to serde, and the expansion phase dominates. So it's basically a stress test for proc macro expansion.

#59476 helped a tiny bit. #59507 helped more. The major remaining source of inefficiency is libproc_macro's buffer for communicating between client and server. Buffer::write_all is called more than a million times, almost always for a single byte, mostly due to uleb128 encoding of integers. @eddyb said they would try to improve that code. I estimate this could save another 10%, maybe more.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-incr-compArea: Incremental compilationC-enhancementCategory: An issue proposing an enhancement or a PR with one.I-compiletimeIssue: Problems and improvements with respect to compile times.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions