Skip to content

Add codegen-units=1  #2699

@gbionescu

Description

@gbionescu

During the 0.25 release we've noticed a significant variation in the binary size, where simply changing the firecracker version would add 15kb to the binary size.

Later investigation showed that LTO was at fault for this change in size - simply disabling the LTO would produce consistent binaries.
Further reading the cargo reference manual on lto shows that No LTO is performed if codegen units is 1 or opt-level is 0.. Testing without LTO indeed produces consistent binaries and as a bonus, smaller ones - the v0.25 one is 0.5 mb smaller.

Also, in the context of a previously opened PR by @KarthikNedunchezhiyan here, I propose that we add codegen-units=1 to the release profile to prevent variations such as this one.

Metadata

Metadata

Labels

Type: FixIndicates a fix to existing code

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions