Skip to content

Commit a16b97d

Browse files
authored
Merge pull request #139 from shepmaster/benchmark-tweaks
Benchmark tweaks
2 parents 88c81e7 + 5f4c327 commit a16b97d

3 files changed

Lines changed: 32 additions & 2 deletions

File tree

‎comparison/generate-delta.R‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,24 @@ deltas |> group_by(algo) |> group_walk(function(data, key) {
5959
})
6060
})
6161

62+
overview = deltas |>
63+
filter(bench == "tiny_data") |>
64+
group_by(algo, fn_name, arch) |>
65+
summarize(
66+
min = min(factor.time),
67+
max = max(factor.time)
68+
)|>
69+
rename(algorithm = algo, entrypoint = fn_name) |>
70+
mutate(
71+
algorithm = str_glue("`{algorithm}`"),
72+
entrypoint = str_glue("`{entrypoint}`"),
73+
arch = str_glue("`{arch}`"),
74+
min = percent(min, accuracy = 1),
75+
max = percent(max, accuracy = 1)
76+
) |>
77+
kable()
78+
79+
message("An overview of changes for the tiny_data benchmark:")
80+
print(overview)
81+
6282
warnings()

‎comparison/harness/src/main.rs‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ mod capture {
233233
use crate::{
234234
CaptureArgs, Error, clean,
235235
git::{self, Cache},
236-
paths::Paths,
236+
paths::{self, Paths},
237237
};
238238

239239
pub fn main(args: CaptureArgs) -> Result<(), Error> {
@@ -300,7 +300,8 @@ mod capture {
300300

301301
let mut c = Command::new("cargo");
302302

303-
c.env("RUSTUP_TOOLCHAIN", "stable")
303+
c.current_dir(paths::comparison_dir())
304+
.env("RUSTUP_TOOLCHAIN", "stable")
304305
.arg("criterion")
305306
.args(["-p", "comparison"])
306307
.arg("--message-format=json");

‎comparison/shared.R‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,15 @@ load_single_trial = function(filename) {
8888
massage_data()
8989
}
9090

91+
trials_from_tree_hash = function(tree_hash) {
92+
data_path = fs::path("captures", tree_hash, "data")
93+
data_path |>
94+
list.dirs(full.names = F, recursive = F) |>
95+
as.numeric() |>
96+
sort() |>
97+
map(\(n) fs::path(data_path, n, "clean.json"))
98+
}
99+
91100
load_benchmark_trials = function(filenames) {
92101
all_data = filenames |>
93102
map(load_json_lines_as_tibble) |>

0 commit comments

Comments
 (0)