This commit is contained in:
nora 2022-04-12 21:56:25 +02:00
parent 5634330287
commit cec7204c6d
5 changed files with 742 additions and 12 deletions

44
rust2/benches/bottles.bf Normal file
View file

@ -0,0 +1,44 @@
>+++++++++[<+++++++++++>-]<[>[-]>[-]<<[>+>+<<-]>>[<<+>>-]>>>
[-]<<<+++++++++<[>>>+<<[>+>[-]<<-]>[<+>-]>[<<++++++++++>>>+<
-]<<-<-]+++++++++>[<->-]>>+>[<[-]<<+>>>-]>[-]+<<[>+>-<<-]<<<
[>>+>+<<<-]>>>[<<<+>>>-]>[<+>-]<<-[>[-]<[-]]>>+<[>[-]<-]<+++
+++++[<++++++<++++++>>-]>>>[>+>+<<-]>>[<<+>>-]<[<<<<<.>>>>>-
]<<<<<<.>>[-]>[-]++++[<++++++++>-]<.>++++[<++++++++>-]<++.>+
++++[<+++++++++>-]<.><+++++..--------.-------.>>[>>+>+<<<-]>
>>[<<<+>>>-]<[<<<<++++++++++++++.>>>>-]<<<<[-]>++++[<+++++++
+>-]<.>+++++++++[<+++++++++>-]<--.---------.>+++++++[<------
---->-]<.>++++++[<+++++++++++>-]<.+++..+++++++++++++.>++++++
++[<---------->-]<--.>+++++++++[<+++++++++>-]<--.-.>++++++++
[<---------->-]<++.>++++++++[<++++++++++>-]<++++.-----------
-.---.>+++++++[<---------->-]<+.>++++++++[<+++++++++++>-]<-.
>++[<----------->-]<.+++++++++++..>+++++++++[<---------->-]<
-----.---.>>>[>+>+<<-]>>[<<+>>-]<[<<<<<.>>>>>-]<<<<<<.>>>+++
+[<++++++>-]<--.>++++[<++++++++>-]<++.>+++++[<+++++++++>-]<.
><+++++..--------.-------.>>[>>+>+<<<-]>>>[<<<+>>>-]<[<<<<++
++++++++++++.>>>>-]<<<<[-]>++++[<++++++++>-]<.>+++++++++[<++
+++++++>-]<--.---------.>+++++++[<---------->-]<.>++++++[<++
+++++++++>-]<.+++..+++++++++++++.>++++++++++[<---------->-]<
-.---.>+++++++[<++++++++++>-]<++++.+++++++++++++.++++++++++.
------.>+++++++[<---------->-]<+.>++++++++[<++++++++++>-]<-.
-.---------.>+++++++[<---------->-]<+.>+++++++[<++++++++++>-
]<--.+++++++++++.++++++++.---------.>++++++++[<---------->-]
<++.>+++++[<+++++++++++++>-]<.+++++++++++++.----------.>++++
+++[<---------->-]<++.>++++++++[<++++++++++>-]<.>+++[<----->
-]<.>+++[<++++++>-]<..>+++++++++[<--------->-]<--.>+++++++[<
++++++++++>-]<+++.+++++++++++.>++++++++[<----------->-]<++++
.>+++++[<+++++++++++++>-]<.>+++[<++++++>-]<-.---.++++++.----
---.----------.>++++++++[<----------->-]<+.---.[-]<<<->[-]>[
-]<<[>+>+<<-]>>[<<+>>-]>>>[-]<<<+++++++++<[>>>+<<[>+>[-]<<-]
>[<+>-]>[<<++++++++++>>>+<-]<<-<-]+++++++++>[<->-]>>+>[<[-]<
<+>>>-]>[-]+<<[>+>-<<-]<<<[>>+>+<<<-]>>>[<<<+>>>-]<>>[<+>-]<
<-[>[-]<[-]]>>+<[>[-]<-]<++++++++[<++++++<++++++>>-]>>>[>+>+
<<-]>>[<<+>>-]<[<<<<<.>>>>>-]<<<<<<.>>[-]>[-]++++[<++++++++>
-]<.>++++[<++++++++>-]<++.>+++++[<+++++++++>-]<.><+++++..---
-----.-------.>>[>>+>+<<<-]>>>[<<<+>>>-]<[<<<<++++++++++++++
.>>>>-]<<<<[-]>++++[<++++++++>-]<.>+++++++++[<+++++++++>-]<-
-.---------.>+++++++[<---------->-]<.>++++++[<+++++++++++>-]
<.+++..+++++++++++++.>++++++++[<---------->-]<--.>+++++++++[
<+++++++++>-]<--.-.>++++++++[<---------->-]<++.>++++++++[<++
++++++++>-]<++++.------------.---.>+++++++[<---------->-]<+.
>++++++++[<+++++++++++>-]<-.>++[<----------->-]<.+++++++++++
..>+++++++++[<---------->-]<-----.---.+++.---.[-]<<<]

View file

@ -1 +0,0 @@
++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.

View file

@ -21,7 +21,7 @@ impl Write for MockReadWrite {
} }
} }
fn run_bf_bench(bf: &str) { fn run_bf(bf: &str) {
let bump = Bump::new(); let bump = Bump::new();
let parsed = brainfuck::parse::parse(&bump, bf.bytes().enumerate()).unwrap(); let parsed = brainfuck::parse::parse(&bump, bf.bytes().enumerate()).unwrap();
let optimized = brainfuck::opts::optimize(&bump, &parsed); let optimized = brainfuck::opts::optimize(&bump, &parsed);
@ -30,18 +30,16 @@ fn run_bf_bench(bf: &str) {
fn optimized(c: &mut Criterion) { fn optimized(c: &mut Criterion) {
let fizzbuzz = include_str!("fizzbuzz.bf"); let fizzbuzz = include_str!("fizzbuzz.bf");
let hello_world = include_str!("hello.bf");
let bench = include_str!("bench.bf"); let bench = include_str!("bench.bf");
let loopremove = include_str!("loopremove.bf"); let loopremove = include_str!("loopremove.bf");
let twinkle = include_str!("twinkle.bf");
let bottles = include_str!("bottles.bf");
c.bench_function("fizzbuzz", |b| b.iter(|| run_bf_bench(black_box(fizzbuzz)))); c.bench_function("fizzbuzz", |b| b.iter(|| run_bf(black_box(fizzbuzz))));
c.bench_function("hello_world", |b| { c.bench_function("bench", |b| b.iter(|| run_bf(black_box(bench))));
b.iter(|| run_bf_bench(black_box(hello_world))) c.bench_function("loopremove", |b| b.iter(|| run_bf(black_box(loopremove))));
}); c.bench_function("twinkle", |b| b.iter(|| run_bf(black_box(twinkle))));
c.bench_function("bench", |b| b.iter(|| run_bf_bench(black_box(bench)))); c.bench_function("bottles", |b| b.iter(|| run_bf(black_box(bottles))));
c.bench_function("loopremove", |b| {
b.iter(|| run_bf_bench(black_box(loopremove)))
});
} }
criterion_group!(benches, optimized); criterion_group!(benches, optimized);

3
rust2/benches/twinkle.bf Normal file

File diff suppressed because one or more lines are too long

View file

@ -1 +1,687 @@
+++[-]. A mandelbrot set fractal viewer in brainf*** written by Erik Bosman+++++++++++++
[->++>>>+++++>++>+<<<<<<]>>>>>++++++>--->>>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