Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cargo.toml
: Set codegen-units = 1
for release
.
This significantly improves code generation and optimization. In C, translation units correspond to each `*.c` file, and thus things are deliberately grouped together. In Rust, codegen units are chosen with a heuristic and functions are assigned to a codegen unit (passed to LLVM). Thus, to ensure related functions are in the same codegen unit (and are thus inlineable), we should set this to 1. This will also make optimization much more reliable, since a far away change can't suddenly affect an optimization elsewhere. We probably also want to look at enabling LTO (though we'll need to enable LTO for `dav1d` for equivalent comparisons).
- Loading branch information