Skip to content

Commit 4ad68c6

Browse files
authored
Merge pull request #9 from bevyengine/compile-time-per-crate
Compile time per crate
2 parents 2de25a5 + a338afe commit 4ad68c6

File tree

6 files changed

+396
-9
lines changed

6 files changed

+396
-9
lines changed

Cargo.lock

Lines changed: 223 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ strum = { version = "0.27", features = ["derive"] }
1313
plotters = "0.3.7"
1414
tera = "1"
1515
chrono = "0.4.41"
16+
statistical = "1.0.0"

src/bin/collect.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use std::{
88

99
use clap::{Parser, Subcommand};
1010
use strum::{EnumIter, IntoEnumIterator};
11-
use twitcher::{Metrics, binary_size, compile_time, stats::Stats};
11+
use twitcher::{Metrics, binary_size, compile_time, crate_compile_time, stats::Stats};
1212
use xshell::{Shell, cmd};
1313

1414
#[derive(Parser, Debug)]
@@ -36,6 +36,7 @@ enum Commands {
3636
#[arg(short, long, default_value = "breakout")]
3737
example: String,
3838
},
39+
CrateCompileTime,
3940
All,
4041
}
4142

@@ -51,6 +52,9 @@ impl Commands {
5152
Box::new(compile_time::CompileTime::on(example, 16)),
5253
]
5354
}
55+
Commands::CrateCompileTime => {
56+
vec![Box::new(crate_compile_time::CrateCompileTime::on(16))]
57+
}
5458
Commands::All => {
5559
if recur {
5660
Commands::iter()

src/bin/graphs.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use std::{
2+
collections::HashSet,
23
fs::{self, File},
34
io::BufReader,
45
path::Path,
@@ -18,8 +19,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
1819
})
1920
.collect();
2021

21-
let zero = stats.first().unwrap();
22-
for metric in zero.metrics.keys() {
22+
let keys: HashSet<_> = stats.iter().flat_map(|stat| stat.metrics.keys()).collect();
23+
for metric in keys {
2324
println!("Metric: {}", metric);
2425
let mut data = stats
2526
.iter()

0 commit comments

Comments
 (0)