mirror of
https://github.com/Noratrieb/brainfuck.git
synced 2026-01-16 22:35:03 +01:00
try to fix pass_cancel_left_right_add_sub
This commit is contained in:
parent
290201ab98
commit
d7fea43acf
7 changed files with 368 additions and 8 deletions
|
|
@ -1,5 +1,5 @@
|
|||
use bumpalo::Bump;
|
||||
use criterion::{black_box, criterion_group, criterion_main, Criterion};
|
||||
use criterion::{black_box, criterion_main, Criterion};
|
||||
use std::io::{Read, Write};
|
||||
|
||||
struct MockReadWrite;
|
||||
|
|
@ -34,14 +34,21 @@ fn optimized(c: &mut Criterion) {
|
|||
let bench = include_str!("bench.bf");
|
||||
let twinkle = include_str!("twinkle.bf");
|
||||
let bottles = include_str!("bottles.bf");
|
||||
let mandelbrot = include_str!("mandelbrot.bf");
|
||||
let hanoi = include_str!("hanoi.bf");
|
||||
|
||||
c.bench_function("fizzbuzz", |b| b.iter(|| run_bf(black_box(fizzbuzz))));
|
||||
c.bench_function("bench", |b| b.iter(|| run_bf(black_box(bench))));
|
||||
c.bench_function("twinkle", |b| b.iter(|| run_bf(black_box(twinkle))));
|
||||
c.bench_function("bottles", |b| b.iter(|| run_bf(black_box(bottles))));
|
||||
c.bench_function("mandelbrot", |b| b.iter(|| run_bf(black_box(mandelbrot))));
|
||||
c.bench_function("hanoi", |b| b.iter(|| run_bf(black_box(hanoi))));
|
||||
}
|
||||
|
||||
criterion_group!(benches, optimized);
|
||||
pub fn benches() {
|
||||
// we need such a low sample size because the benches take ages otherwise
|
||||
let mut c = Criterion::default().configure_from_args().sample_size(30);
|
||||
optimized(&mut c);
|
||||
}
|
||||
|
||||
criterion_main!(benches);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue