Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions native/src/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use std::{
time::{Duration, Instant},
};

#[cfg(target_arch = "x86_64")]
use gameroy_jit::CompilerOpts;
use gameroy_lib::gameroy::{
consts::CLOCK_SPEED,
Expand Down Expand Up @@ -42,6 +43,7 @@ fn print_val(val: f64, err: f64) -> String {
format!("{:.p$} +/- {:.p$}", val, err, p = p)
}

#[allow(unused_variables)]
pub fn benchmark(
Bench {
rom_path: ref path,
Expand Down Expand Up @@ -109,9 +111,12 @@ pub fn benchmark(
);

// Remove first run, because in that one the code is traced.
times.remove(0);
#[cfg(target_arch = "x86_64")]
{
times.remove(0);

print_stats(times, game_boy.clock_count - start_clock_count);
print_stats(times, game_boy.clock_count - start_clock_count);
}
}
}

Expand Down Expand Up @@ -169,6 +174,7 @@ fn run_jitted(
times
}

#[cfg(target_arch = "x86_64")]
#[inline(never)]
fn pre_run(game_boy: &mut GameBoy, timeout: u64, jit_compiler: &mut gameroy_jit::JitCompiler) {
game_boy.reset();
Expand Down
Loading