chore: remove benchmarks

This commit is contained in:
Muhammad Nauman Raza 2024-03-23 20:42:08 +00:00
parent a3154afc65
commit c1e68f3564
No known key found for this signature in database
GPG key ID: 31BC90D626D2DBBE
5 changed files with 1 additions and 61 deletions

View file

@ -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"]
debugger = ["nom", "rustyline", "fuzzy-matcher", "elf_support"]

View file

@ -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);

View file

@ -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

Binary file not shown.