Skip to content

Commit d41f1bf

Browse files
authored
Merge pull request #1413 from rust-lang/size-benchmarks
Add `helloworld-tiny` benchmark
2 parents cb2639c + b84f4cd commit d41f1bf

File tree

5 files changed

+32
-0
lines changed

5 files changed

+32
-0
lines changed

collector/benchmarks/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ compiler in interesting ways.
7979
the past.
8080
- **derive**: A large number of simple structs with a `#[derive]` attribute for common built-in traits such as Copy and Debug.
8181
- **externs**: A large number of extern functions has caused [slowdowns in the past](https://github.com/rust-lang/rust/pull/78448).
82+
- **helloworld-tiny**: A trivial program optimized with flags that should reduce binary size.
83+
Gives a lower bound on compiled binary size.
8284
- **issue-46449**: A small program that caused [poor
8385
performance](https://github.com/rust-lang/rust/issues/46449) in the past.
8486
- **issue-58319**: A small program that caused [poor

collector/benchmarks/helloworld-tiny/Cargo.lock

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[package]
2+
name = "helloworld-tiny"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
[dependencies]
7+
8+
[workspace]
9+
10+
[profile.release]
11+
opt-level = "z"
12+
lto = true
13+
codegen-units = 1
14+
panic = "abort"
15+
strip = true
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"category": "secondary",
3+
"excluded_profiles": ["Doc", "Check", "Debug"],
4+
"excluded_scenarios": ["IncrFull", "IncrPatched", "IncrUnchanged"]
5+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fn main() {
2+
println!("Hello world!");
3+
}

0 commit comments

Comments
 (0)