diff --git a/core/Cargo.toml b/core/Cargo.toml index e40e388..1fab0eb 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -47,11 +47,7 @@ xml-builder = "0.5.0" [dev-dependencies] criterion = "0.3" -[[bench]] -name = "performance" -harness = false - [features] default = [] elf_support = [] -debugger = ["nom", "rustyline", "fuzzy-matcher", "elf_support"] \ No newline at end of file +debugger = ["nom", "rustyline", "fuzzy-matcher", "elf_support"] diff --git a/core/benches/performance.rs b/core/benches/performance.rs deleted file mode 100644 index 402414b..0000000 --- a/core/benches/performance.rs +++ /dev/null @@ -1,52 +0,0 @@ -/// Measure first 60 frames bigmap.gba from tonc demos -/// -use criterion::{black_box, criterion_group, criterion_main, BatchSize, Criterion}; - -use std::cell::RefCell; -use std::rc::Rc; - -use rustboyadvance_core::prelude::*; - -fn create_gba() -> GameBoyAdvance { - // TODO: do I really want this file in my repository ? - let bios = include_bytes!("roms/normatt_gba_bios.bin"); - let bigmap_rom = include_bytes!("roms/bigmap.gba"); - - let gpak = GamepakBuilder::new() - .take_buffer(bigmap_rom.to_vec().into_boxed_slice()) - .with_sram() - .without_backup_to_file() - .build() - .unwrap(); - - let mut gba = GameBoyAdvance::new(bios.to_vec().into_boxed_slice(), gpak, NullAudio::new()); - gba.skip_bios(); - // skip initialization of the ROM to get to a stabilized scene - for _ in 0..60 { - gba.frame(); - } - gba -} - -pub fn performance_benchmark(c: &mut Criterion) { - c.bench_function("run_60_frames", |b| { - b.iter_batched( - // setup - || create_gba(), - // bencher - |mut gba| { - for _ in 0..60 { - black_box(gba.frame()) - } - }, - BatchSize::SmallInput, - ) - }); -} - -criterion_group! { - name = benches; - config = Criterion::default().sample_size(10); - targets = performance_benchmark -} -criterion_main!(benches); diff --git a/core/benches/roms/README.md b/core/benches/roms/README.md deleted file mode 100644 index e830618..0000000 --- a/core/benches/roms/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Files - -* bigmap.gba - This is a test rom from TONC, more test roms can be obtained from https://www.coranac.com/files/tonc-bin.zip -* normatt_gba_bios.bin - An open source GBA bios rom that can obtained from https://github.com/Nebuleon/ReGBA/raw/master/bios/gba_bios.bin diff --git a/core/benches/roms/bigmap.gba b/core/benches/roms/bigmap.gba deleted file mode 100755 index a72111f..0000000 Binary files a/core/benches/roms/bigmap.gba and /dev/null differ diff --git a/core/benches/roms/normatt_gba_bios.bin b/core/benches/roms/normatt_gba_bios.bin deleted file mode 100644 index 802982e..0000000 Binary files a/core/benches/roms/normatt_gba_bios.bin and /dev/null differ