Skip to content

codegen-units=16 doubles compile times for Firefox #48233

Closed
@Manishearth

Description

@Manishearth

https://bugzilla.mozilla.org/show_bug.cgi?id=1436251

The other day I was experimenting with codegen-units, and realized that Firefox's build gets really slow with codgen-units=16 (the default):

with codegen-units=1
real    20m35.218s
user    135m46.044s
sys     5m49.332s

with default codegen-units (16)
real    38m3.751s
user    156m53.384s
sys     6m22.100s

I wasn't able to reduce the testcase.

If you wish to do it, use nightly to build Firefox with the following mozconfig file:

ac_add_options --enable-debug
ac_add_options --enable-optimize
ac_add_options --enable-release

and revert this patch: https://hg.mozilla.org/mozilla-central/rev/fe90c7d53a7c

A useful bit of information may be that we pass -Clto only to the toplevel crate, i.e. we build with cargo rustc -- -Clto. I don't remember but it might have been only the last crate ("gkrust") taking forever to build (I can retest this if you wish) so it might be some pathological case with LTO.

cc @michaelwoerister

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-codegenArea: Code generationC-enhancementCategory: An issue proposing an enhancement or a PR with one.I-compiletimeIssue: Problems and improvements with respect to compile times.P-mediumMedium priorityT-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