Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 0.4.0 #496

Merged
merged 35 commits into from
Sep 10, 2022
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
f013a5d
Remove deprecated functions.
lemmih Jul 26, 2021
0ef6c82
Run CI for pull requests to the version-0.4 branch.
lemmih Jul 26, 2021
6355148
Honor optional feature flags. (#497)
lemmih Jul 26, 2021
e7c08b3
Changes error messages output to stderr (#412)
gifnksm Jul 26, 2021
09efa53
Basic support for targeting wasm32-wasi (#498)
lemmih Jul 26, 2021
e8bb66d
Don't try to copy CSV files that weren't generated. (#499)
lemmih Jul 27, 2021
4b80187
Use terminal code, send results to stdout, and messages to stderr. (#…
lemmih Jul 27, 2021
43f9751
Accept subsecond durations from the command line. (#501)
lemmih Jul 27, 2021
c1b3466
Remove the deprecated 'iter_with_large_setup'. (#502)
lemmih Jul 27, 2021
6d3161e
Test WASI functionality in CI run. (#503)
lemmih Jul 27, 2021
f862a1b
Remove a few unsafe ops since the compiler can prove they are safe. (…
lemmih Jul 28, 2021
791a97f
Fix trailing semicolon in macros.
lemmih Aug 10, 2021
7b8030b
Add --quiet flag for printing a single line per benchmark. (#510)
lemmih Aug 10, 2021
db880ab
Merge branch 'master' into version-0.4
lemmih Oct 24, 2021
77f1b38
Add flag to allow baseline comparisons to succeed when a baseline can…
rukai Nov 15, 2021
6d4eff5
Merge branch 'master' into version-0.4
lemmih Jan 2, 2022
412591e
Enable --quick mode. (#535)
lemmih Jan 2, 2022
a9c42f0
Compare baselines with critcmp. (#540)
lemmih Feb 13, 2022
08bdb9a
Improved WASI support (#550)
lemmih Feb 13, 2022
6929f48
WASI: Update missing firefox results.
lemmih Feb 13, 2022
4b37d8a
Merge branch 'master' into version-0.4
lemmih Feb 28, 2022
d4593f4
replace `serde_cbor` with `ciborium` (#560)
crepererum Jul 2, 2022
a00c592
Upgrade to clap v3 (#543)
benesch Jul 2, 2022
f73aebb
Merge branch 'master' into version-0.4
lemmih Jul 2, 2022
c334339
Merge branch 'master' into version-0.4
lemmih Jul 2, 2022
1a66bb7
Bump MSRV to 1.56.1
lemmih Jul 2, 2022
5cb91ab
Set required clap parameter.
lemmih Jul 2, 2022
6127032
bump the regex to 1.5 (#525)
guanqun Jul 2, 2022
77e4ae2
Merge branch 'master' into version-0.4
lemmih Jul 2, 2022
758b324
Bump minimum version of 'anes' to 0.1.4
lemmih Jul 2, 2022
ecfd1d1
Update CHANGELOG with v0.4 changes.
lemmih Jul 2, 2022
2934163
Add missing black_box for bench_with_input parameters. Fixes 566.
bheisler Jul 15, 2022
a18d080
Merge branch 'master' into version-0.4
lemmih Aug 23, 2022
f82ce59
Remove critcmp code (it belongs in cargo-criterion) (#610)
lemmih Aug 23, 2022
935c632
Add Throughput::BytesDecimal. Fixes #581.
bheisler Sep 10, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
35 changes: 34 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
pull_request:
branches:
- master
- version-0.4

name: tests

Expand All @@ -23,32 +24,64 @@ jobs:
- uses: actions/checkout@v2

- uses: actions-rs/toolchain@v1
name: Setup rust toolchain
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
components: rustfmt, clippy

- uses: Swatinem/rust-cache@v1
name: Load dependencies from cache

- uses: actions-rs/cargo@v1
name: Build with stable features
with:
command: build
args: --features stable

- uses: actions-rs/cargo@v1
if: ${{ matrix.rust == 'nightly' }}
name: Build with unstable features
with:
command: build
args: --all-features

- uses: actions-rs/cargo@v1
name: Build with minimal features
with:
command: build
args: --no-default-features

- uses: actions-rs/cargo@v1
name: Test with stable features
with:
command: test
args: --features stable

- uses: actions-rs/cargo@v1
name: Test with minimal features
with:
command: test
args: --no-default-features

- uses: actions-rs/cargo@v1
name: Check for non-standard formatting
if: ${{ matrix.rust == 'stable' }}
with:
command: fmt
args: --all -- --check

- uses: actions-rs/cargo@v1
if: ${{ matrix.rust != '1.40.0' }} # 1.40 has horrible lints.
name: Check for clippy hints
with:
command: clippy
args: -- -D warnings

- name: Test run targeting WASI
run: |
curl https://wasmtime.dev/install.sh -sSf | bash
source ~/.bashrc
export PATH=$HOME/.wasmtime/bin/:$PATH
cargo install cargo-wasi
cargo wasi bench --no-default-features -- --test
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [0.4.0] - IN DEVELOPMENT

### Removed
- The `Criterion::can_plot` function has been removed.
- The `Criterion::bench_function_over_inputs` function has been removed.
- The `Criterion::bench_functions` function has been removed.
- The `Criterion::bench` function has been removed.

### Changed
- HTML report hidden behind non-default feature flag: 'html_reports'
- Standalone support (ie without cargo-criterion) feature flag: 'cargo_bench_support'

## [Unreleased]

## [0.3.5] - 2021-07-26
Expand Down
31 changes: 21 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ license = "Apache-2.0/MIT"
exclude = ["book/*"]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be good to set version = "0.4.0" now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would that make it easier for people to test this branch?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was easier for me to test with it left as-is, because I could use [patch.crates-io] to insert it into other dependencies like criterion-cycles-per-byte and pprof.


[dependencies]
anes = "0.1"
lemmih marked this conversation as resolved.
Show resolved Hide resolved
lazy_static = "1.4"
criterion-plot = { path = "plot", version = "0.4.4" }
itertools = "0.10"
Expand All @@ -26,21 +27,24 @@ serde_derive = "1.0"
serde_cbor = "0.11"
atty = "0.2"
clap = { version = "2.33", default-features = false }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My initial feedback: This branch with default-features=false and opting into no optional features is a drop-in replacement for 0.3.4 for me insofar as my benchmarks build and run using this version, simply with this change:

 [dev-dependencies]
-criterion = "0.3.5"
+criterion = { git = "https://github.com/bheisler/criterion.rs", branch = "version-0.4", commit = "7b8030b1223adacebf81b8e1cb3286a83e7a2470", default-features=false}

How practical would it be to move the anes, atty, clap, criterion-plot, and serde_cbor (at least) dependencies out of the "no default features" configuration?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's the cargo-tree of dependencies with default-features=false:

│   ├── anes v0.1.6
│   ├── atty v0.2.14
│   │   └── winapi v0.3.9
│   ├── cast v0.2.7
│   │   [build-dependencies]
│   │   └── rustc_version v0.4.0
│   │       └── semver v1.0.4
│   ├── clap v2.33.3
│   │   ├── bitflags v1.3.2
│   │   ├── textwrap v0.11.0
│   │   │   └── unicode-width v0.1.8
│   │   └── unicode-width v0.1.8
│   ├── criterion-plot v0.4.3 (https://github.com/bheisler/criterion.rs?branch=version-0.4#7b8030b1)
│   │   ├── cast v0.2.7 (*)
│   │   └── itertools v0.10.1
│   │       └── either v1.6.1
│   ├── itertools v0.10.1 (*)
│   ├── lazy_static v1.4.0
│   ├── num-traits v0.2.14
│   │   [build-dependencies]
│   │   └── autocfg v1.0.1
│   ├── oorandom v11.1.3
│   ├── regex v1.5.4
│   │   └── regex-syntax v0.6.25
│   ├── serde v1.0.128
│   ├── serde_cbor v0.11.2
│   │   ├── half v1.7.1
│   │   └── serde v1.0.128
│   ├── serde_derive v1.0.128 (proc-macro)
│   │   ├── proc-macro2 v1.0.28
│   │   │   └── unicode-xid v0.2.2
│   │   ├── quote v1.0.9
│   │   │   └── proc-macro2 v1.0.28 (*)
│   │   └── syn v1.0.75
│   │       ├── proc-macro2 v1.0.28 (*)
│   │       ├── quote v1.0.9 (*)
│   │       └── unicode-xid v0.2.2
│   ├── serde_json v1.0.66
│   │   ├── itoa v0.4.8
│   │   ├── ryu v1.0.5
│   │   └── serde v1.0.128
│   ├── tinytemplate v1.2.1
│   │   ├── serde v1.0.128
│   │   └── serde_json v1.0.66 (*)
│   └── walkdir v2.3.2
│       ├── same-file v1.0.6
│       │   └── winapi-util v0.1.5
│       │       └── winapi v0.3.9
│       ├── winapi v0.3.9
│       └── winapi-util v0.1.5 (*)

Some comments:

│   ├── cast v0.2.7
│   │   [build-dependencies]
│   │   └── rustc_version v0.4.0
│   │       └── semver v1.0.4

Not sure that cast is really carrying its weight considering the overhead it adds to the build. Either we could try to remove cast or we could work with the cast developers to simplify its build dependencies; I filed japaric/cast.rs#35 to that effect.

│   ├── clap v2.33.3
│   │   ├── bitflags v1.3.2
│   │   ├── textwrap v0.11.0
│   │   │   └── unicode-width v0.1.8
│   │   └── unicode-width v0.1.8

I don't fully understand how important clap::value_t is or how difficult it would be to replace, but I noticed if we could avoid using clap::value_t then we wouldn't need to depend on clap when the cargo-clippy feature isn't selected. So I think it is worth trying to find an alternative to value_t.

│   ├── serde v1.0.128
│   ├── serde_cbor v0.11.2
│   │   ├── half v1.7.1
│   │   └── serde v1.0.128
│   ├── serde_derive v1.0.128 (proc-macro)
│   │   ├── proc-macro2 v1.0.28
│   │   │   └── unicode-xid v0.2.2
│   │   ├── quote v1.0.9
│   │   │   └── proc-macro2 v1.0.28 (*)
│   │   └── syn v1.0.75
│   │       ├── proc-macro2 v1.0.28 (*)
│   │       ├── quote v1.0.9 (*)
│   │       └── unicode-xid v0.2.2
│   ├── serde_json v1.0.66
│   │   ├── itoa v0.4.8
│   │   ├── ryu v1.0.5
│   │   └── serde v1.0.128

Serde is a very heavy dependency. Granted, most of my projects use it anyway, so eliminating serde and serde-derive wouldn't have as wide an impact as removing other dependencies. However, I think finding a way to remove serde_cbor or serde_json (perhaps just default to one or the other) or both (In my CI jobs, I don't want any serializatoin at all since I don't do anything with serialized output; I just want to verify that the benchmarks still build and run) would be a good win.

│   └── walkdir v2.3.2
│       ├── same-file v1.0.6
│       │   └── winapi-util v0.1.5
│       │       └── winapi v0.3.9
│       ├── winapi v0.3.9
│       └── winapi-util v0.1.5 (*)

Again, in the pretty common situation where in CI where we're only verifying that the benchmarks compile and run correctly, and where we don't want any persistence anyway, we should be able to eliminate all the functionality that does file I/O and then eliminate this pretty heavy dependency.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be possible to make serde an optional dependency and have functionality degrade gracefully (ie. running/testing benchmarks should still work but saving/loading baselines would print an error message). I'll gladly review such a PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How practical would it be to move the anes, atty, clap, criterion-plot, and serde_cbor (at least) dependencies out of the "no default features" configuration?

criterion-plot is scheduled to be removed entirely (either in version 0.4 or 0.5). serde could be optional but it would take a fair bit of work/refactoring. I guess anes and atty could be optional but they're so tiny that I don't really see the point. clap is quite vital, though, and I don't see how criterion could work without it.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll gladly review such a PR.

OK, when I have time, I will try that. Will you be merging this PR (#496) soon? It would be easier for me to make my PRs on top of this one.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll gladly review such a PR.

OK, when I have time, I will try that. Will you be merging this PR (#496) soon? It would be easier for me to make my PRs on top of this one.

Probably won't be merged any time soon. You can submit your PR directly against this branch: Checkout version-0.4, push a new branch, and create a PR (or draft PR) with the target being version-0.4 from the drop-down menu.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had intended for command-line parsing and output and the like to start shifting over to cargo-criterion with the 0.4 release, so I think clap and anes and related crates should be behind the cargo-bench-support feature. That code would need to still be available in criterion-rs for the time being to give users time to migrate over to cargo-criterion (that's the purpose of the cargo-bench-support feature).

csv = "1.1"
walkdir = "2.3"
tinytemplate = "1.1"
cast = "0.2"
num-traits = { version = "0.2", default-features = false }
num-traits = { version = "0.2", default-features = false, features = ["std"] }
oorandom = "11.1"
rayon = "1.3"
regex = { version = "1.3", default-features = false, features = ["std"] }
futures = { version = "0.3", default_features = false, optional = true }
smol = { version = "1.2", default-features = false, optional = true }
tokio = { version = "1.0", default-features = false, features = ["rt"], optional = true }
async-std = { version = "1.9", optional = true }

# Optional dependencies
rayon = { version = "1.3", optional = true }
csv = { version = "1.1", optional = true }
futures = { version = "0.3", default_features = false, optional = true }
smol = { version = "1.2", default-features = false, optional = true }
tokio = { version = "1.0", default-features = false, features = ["rt"], optional = true }
async-std = { version = "1.9", optional = true }

[dependencies.plotters]
version = "^0.3.1"
optional = true
default-features = false
features = ["svg_backend", "area_series", "line_series"]

Expand All @@ -55,8 +59,15 @@ futures = { version = "0.3", default_features = false, features = ["executor"
maintenance = { status = "passively-maintained" }

[features]
stable = ["async_futures", "async_smol", "async_tokio", "async_std"]
default = ["cargo_bench_support"]
stable = [
"csv_output",
"html_reports",
"async_futures",
"async_smol",
"async_tokio",
"async_std",
]
default = ["rayon", "plotters", "cargo_bench_support"]

# Enable use of the nightly-only test::black_box function to discourage compiler optimizations.
real_blackbox = []
Expand All @@ -82,7 +93,7 @@ cargo_bench_support = []
# This feature _currently_ does nothing, but in 0.4.0 it will be
# required in order to have Criterion.rs generate CSV files. This feature is deprecated in favor of
# cargo-criterion's --message-format=json option.
csv_output = []
csv_output = ["csv"]

[workspace]
exclude = ["cargo-criterion"]
Expand Down
49 changes: 5 additions & 44 deletions benches/benchmarks/compare_functions.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#![allow(deprecated)]

use criterion::{criterion_group, BenchmarkId, Criterion, Fun, ParameterizedBenchmark};
use criterion::{criterion_group, BenchmarkId, Criterion};

fn fibonacci_slow(n: u64) -> u64 {
match n {
Expand All @@ -27,23 +25,10 @@ fn fibonacci_fast(n: u64) -> u64 {
}

fn compare_fibonaccis(c: &mut Criterion) {
let fib_slow = Fun::new("Recursive", |b, i| b.iter(|| fibonacci_slow(*i)));
let fib_fast = Fun::new("Iterative", |b, i| b.iter(|| fibonacci_fast(*i)));

let functions = vec![fib_slow, fib_fast];
let mut group = c.benchmark_group("Fibonacci");

c.bench_functions("Fibonacci", functions, 20);
}
fn compare_fibonaccis_builder(c: &mut Criterion) {
c.bench(
"Fibonacci2",
ParameterizedBenchmark::new(
"Recursive",
|b, i| b.iter(|| fibonacci_slow(*i)),
vec![20u64, 21u64],
)
.with_function("Iterative", |b, i| b.iter(|| fibonacci_fast(*i))),
);
group.bench_with_input("Recursive", &20, |b, i| b.iter(|| fibonacci_slow(*i)));
group.bench_with_input("Iterative", &20, |b, i| b.iter(|| fibonacci_fast(*i)));
}
fn compare_fibonaccis_group(c: &mut Criterion) {
let mut group = c.benchmark_group("Fibonacci3");
Expand All @@ -58,28 +43,4 @@ fn compare_fibonaccis_group(c: &mut Criterion) {
group.finish()
}

fn compare_looped(c: &mut Criterion) {
use criterion::black_box;

c.bench(
"small",
ParameterizedBenchmark::new("unlooped", |b, i| b.iter(|| i + 10), vec![10]).with_function(
"looped",
|b, i| {
b.iter(|| {
for _ in 0..10_000 {
black_box(i + 10);
}
})
},
),
);
}

criterion_group!(
fibonaccis,
compare_fibonaccis,
compare_fibonaccis_builder,
compare_fibonaccis_group,
compare_looped
);
criterion_group!(fibonaccis, compare_fibonaccis, compare_fibonaccis_group,);
1 change: 0 additions & 1 deletion benches/benchmarks/external_process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ fn create_command() -> Command {
command
}

#[allow(deprecated)]
fn python_fibonacci(c: &mut Criterion) {
let has_python3 = Command::new("python3")
.arg("--version")
Expand Down
28 changes: 11 additions & 17 deletions benches/benchmarks/iter_with_large_drop.rs
Original file line number Diff line number Diff line change
@@ -1,28 +1,22 @@
#![allow(deprecated)]

use criterion::{criterion_group, Benchmark, Criterion, Throughput};
use criterion::{criterion_group, Criterion, Throughput};
use std::time::Duration;

const SIZE: usize = 1024 * 1024;

fn large_drop(c: &mut Criterion) {
c.bench(
"iter_with_large_drop",
Benchmark::new("large_drop", |b| {
let v: Vec<_> = (0..SIZE).map(|i| i as u8).collect();
b.iter_with_large_drop(|| v.clone());
})
.throughput(Throughput::Bytes(SIZE as u64)),
);
let mut group = c.benchmark_group("iter_with_large_drop");
group.throughput(Throughput::Bytes(SIZE as u64));
group.bench_function("large_drop", |b| {
let v: Vec<_> = (0..SIZE).map(|i| i as u8).collect();
b.iter_with_large_drop(|| v.clone());
});
}

fn small_drop(c: &mut Criterion) {
c.bench(
"iter_with_large_drop",
Benchmark::new("small_drop", |b| {
b.iter_with_large_drop(|| SIZE);
}),
);
let mut group = c.benchmark_group("iter_with_large_drop");
group.bench_function("small_drop", |b| {
b.iter_with_large_drop(|| SIZE);
});
}

fn short_warmup() -> Criterion {
Expand Down
35 changes: 14 additions & 21 deletions benches/benchmarks/iter_with_large_setup.rs
Original file line number Diff line number Diff line change
@@ -1,32 +1,25 @@
#![allow(deprecated)]

use criterion::{criterion_group, Benchmark, Criterion, Throughput};
use criterion::{criterion_group, BatchSize, Criterion, Throughput};
use std::time::Duration;

const SIZE: usize = 1024 * 1024;

fn large_setup(c: &mut Criterion) {
c.bench(
"iter_with_large_setup",
Benchmark::new("large_setup", |b| {
// NOTE: iter_with_large_setup is deprecated. Use iter_batched instead.
b.iter_with_large_setup(
|| (0..SIZE).map(|i| i as u8).collect::<Vec<_>>(),
|v| v.clone(),
)
})
.throughput(Throughput::Bytes(SIZE as u64)),
);
let mut group = c.benchmark_group("iter_with_large_setup");
group.throughput(Throughput::Bytes(SIZE as u64));
group.bench_function("large_setup", |b| {
b.iter_batched(
|| (0..SIZE).map(|i| i as u8).collect::<Vec<_>>(),
|v| v.clone(),
BatchSize::NumBatches(1),
)
});
}

fn small_setup(c: &mut Criterion) {
c.bench(
"iter_with_large_setup",
Benchmark::new("small_setup", |b| {
// NOTE: iter_with_large_setup is deprecated. Use iter_batched instead.
b.iter_with_large_setup(|| SIZE, |size| size)
}),
);
let mut group = c.benchmark_group("iter_with_large_setup");
group.bench_function("small_setup", |b| {
b.iter_batched(|| SIZE, |size| size, BatchSize::NumBatches(1))
});
}

fn short_warmup() -> Criterion {
Expand Down
2 changes: 1 addition & 1 deletion benches/benchmarks/measurement_overhead.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ fn some_benchmark(c: &mut Criterion) {
group.bench_function("iter", |b| b.iter(|| 1));
group.bench_function("iter_with_setup", |b| b.iter_with_setup(|| (), |_| 1));
group.bench_function("iter_with_large_setup", |b| {
b.iter_with_large_setup(|| (), |_| 1)
b.iter_batched(|| (), |_| 1, BatchSize::NumBatches(1))
});
group.bench_function("iter_with_large_drop", |b| b.iter_with_large_drop(|| 1));
group.bench_function("iter_batched_small_input", |b| {
Expand Down
2 changes: 0 additions & 2 deletions plot/src/data.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![allow(deprecated)]

use std::mem;

use cast::From as _0;
Expand Down
11 changes: 6 additions & 5 deletions src/analysis/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ macro_rules! elapsed {
info!(
"{} took {}",
$msg,
crate::format::time(crate::DurationExt::to_nanos(elapsed) as f64)
crate::format::time(elapsed.as_nanos() as f64)
);

out
Expand Down Expand Up @@ -128,7 +128,7 @@ pub(crate) fn common<M: Measurement, T: ?Sized>(
.collect::<Vec<f64>>();
let avg_times = Sample::new(&avg_times);

if criterion.connection.is_none() && criterion.load_baseline.is_none() {
if criterion.should_save_baseline() {
log_if_err!({
let mut new_dir = criterion.output_directory.clone();
new_dir.push(id.as_directory_name());
Expand All @@ -139,7 +139,7 @@ pub(crate) fn common<M: Measurement, T: ?Sized>(

let data = Data::new(&iters, &times);
let labeled_sample = tukey::classify(avg_times);
if criterion.connection.is_none() {
if criterion.should_save_baseline() {
log_if_err!({
let mut tukey_file = criterion.output_directory.to_owned();
tukey_file.push(id.as_directory_name());
Expand All @@ -156,7 +156,7 @@ pub(crate) fn common<M: Measurement, T: ?Sized>(
distributions.slope = Some(distribution);
}

if criterion.connection.is_none() && criterion.load_baseline.is_none() {
if criterion.should_save_baseline() {
log_if_err!({
let mut sample_file = criterion.output_directory.clone();
sample_file.push(id.as_directory_name());
Expand Down Expand Up @@ -237,7 +237,7 @@ pub(crate) fn common<M: Measurement, T: ?Sized>(
criterion.measurement.formatter(),
);

if criterion.connection.is_none() && criterion.load_baseline.is_none() {
if criterion.should_save_baseline() {
log_if_err!({
let mut benchmark_file = criterion.output_directory.clone();
benchmark_file.push(id.as_directory_name());
Expand Down Expand Up @@ -365,5 +365,6 @@ fn copy_new_dir_to_base(id: &str, baseline: &str, output_directory: &Path) {
&new_dir.join("benchmark.json"),
&base_dir.join("benchmark.json")
));
#[cfg(feature = "csv_output")]
try_else_return!(fs::cp(&new_dir.join("raw.csv"), &base_dir.join("raw.csv")));
}