-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
452 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
use std::fmt; | ||
|
||
use aoc2024::*; | ||
use criterion::*; | ||
|
||
fn bench(criterion_manager: &mut Criterion) { | ||
fn run(criterion_manager: &mut Criterion) -> anyhow::Result<()> { | ||
aoc2024::bench!(criterion_manager); | ||
Ok(()) | ||
} | ||
|
||
run(criterion_manager).unwrap(); | ||
} | ||
|
||
fn call_benched<In: Parse, Out: fmt::Display>(b: &mut Bencher, day: u32, f: impl FnMut(In) -> Out) { | ||
let input = load_input(Mode::Private, day).unwrap(); | ||
let parsed: In = Parse::parse(&input); | ||
b.iter_batched(|| parsed.clone(), f, BatchSize::LargeInput); | ||
} | ||
|
||
criterion_group!(benches, bench); | ||
criterion_main!(benches); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#[cfg(feature = "iai-bench")] | ||
aoc2024::iai!(); | ||
Check failure on line 2 in benches/iai.rs GitHub Actions / run benchmark
Check failure on line 2 in benches/iai.rs GitHub Actions / run benchmark
Check failure on line 2 in benches/iai.rs GitHub Actions / run benchmark
Check failure on line 2 in benches/iai.rs GitHub Actions / run benchmark
|
||
|
||
#[cfg(not(feature = "iai-bench"))] | ||
fn main() {} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[package] | ||
name = "macros" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[lib] | ||
proc-macro = true | ||
|
||
[dependencies] | ||
itertools = "0.13.0" | ||
proc-macro2 = "1.0.92" | ||
quote = "1.0.37" | ||
syn = "2.0.90" |
Oops, something went wrong.