[IDEA] Optimizing wheels with PGO #46
Labels
enhancement
New feature or request
not-worth
A not-so-worth optimization, that has zero or very limited positive impact on performances
This feature suggestion is highly inspired from maciejhirsz/logos#374, a repository I maintain.
Actually, the idea would be to follow what
pydantic-core
does, see https://github.com/pydantic/pydantic-core/blob/44621f1dee5160c737a0749d21e0b2118fa99705/.github/workflows/ci.yml#L464-L557, to generate more performant code.The setup for DiffeRT should be as follows:
RUSTFLAGS='-Cprofile-generate=/tmp/pgo-data/profdata' maturin build --release --out pgo-wheel
llvm-profdata
may change, see https://doc.rust-lang.org/rustc/profile-guided-optimization.html.~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata merge -o /tmp/pgo-data/merged.profdata /tmp/pgo-data/profdata
RUSTFLAGS='-Cprofile-use=/tmp/pgo-data/merged.profdata' maturin build --release --out dist
The only question I have is whether this is actually useful (did run a benchmark after, but not improvement noticed). I might need to write better benchmarks (that target actually what I want to optimize).
The text was updated successfully, but these errors were encountered: