Skip to content

Commit 1bf080a

Browse files
authored
Merge pull request #268 from hatoo/pgo
Enable: Profile-Guided Optimization (PGO)
2 parents 94b63ab + a217332 commit 1bf080a

File tree

6 files changed

+920
-1
lines changed

6 files changed

+920
-1
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
/target
1+
**/target
22
/.idea
33
/.vscode

Cargo.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,14 @@ regex = "1.9.6"
8484
[target.'cfg(unix)'.dev-dependencies]
8585
tempfile = "3.10.0"
8686
actix-web = "4"
87+
88+
[profile.pgo]
89+
inherits = "release"
90+
# https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/frameworks/Rust/faf/Cargo.toml + lto=true
91+
opt-level = 3
92+
panic = 'abort'
93+
codegen-units = 1
94+
lto = true
95+
debug = false
96+
incremental = false
97+
overflow-checks = false

justfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
pgo:
2+
#!/bin/bash
3+
trap "kill 0" EXIT
4+
cargo run --release --manifest-path pgo/server/Cargo.toml &
5+
# Should be more than 1m
6+
cargo pgo run -- --profile pgo -- -z 3m -c 900 --no-tui http://localhost:8888
7+
cargo pgo optimize build -- --profile pgo

0 commit comments

Comments
 (0)