Created
June 9, 2021 16:35
-
-
Save 1480c1/5c3201beb464ecb39599a84220f29342 to your computer and use it in GitHub Desktop.
rav1e pgo stuff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
# Replace --target with your own, it seems it's recommended to have it there | |
# explicitly according to rust's docs | |
# normal build | |
cargo build --release --target=x86_64-unknown-linux-gnu | |
# compile with profile-generate | |
mkdir -p pgo-profile | |
RUSTFLAGS="-Cprofile-generate=$PWD/pgo-profile" \ | |
cargo build --release --target=x86_64-unknown-linux-gnu --target-dir pgo | |
# run encoder on test set, doesn't need to be parallel | |
parallel -u ./pgo/x86_64-unknown-linux-gnu/release/rav1e --output /dev/null --threads "$(nproc)" ::: ./objective-1-fast/*.y4m | |
# merge the data | |
llvm-profdata merge -o "$PWD/pgo-profile/merged.profdata" "$PWD/pgo-profile" | |
# compile with profile-use | |
RUSTFLAGS="-Cprofile-use=$PWD/pgo-profile/merged.profdata -Cllvm-args=-pgo-warn-missing-function" \ | |
cargo build --release --target=x86_64-unknown-linux-gnu --target-dir pgo | |
# final binary avilable at ./pgo/x86_64-unknown-linux-gnu/release/rav1e |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment