feat: 添加基准测试基础设施

This commit is contained in:
2026-06-24 10:46:59 +08:00
parent 3ea2353194
commit cdd709ef03
32 changed files with 1215 additions and 10 deletions
+20
View File
@@ -0,0 +1,20 @@
pub fn run_rust_bench(filter: Option<&str>) -> std::process::ExitCode {
let mut cmd = std::process::Command::new("cargo");
cmd.args(["bench", "-p", "oxide_vm"]);
if let Some(name) = filter {
cmd.args(["--bench", name]);
}
match cmd.status() {
Ok(status) => {
if status.success() {
std::process::ExitCode::SUCCESS
} else {
std::process::ExitCode::from(1)
}
}
Err(e) => {
eprintln!("Failed to run cargo bench: {}", e);
std::process::ExitCode::from(1)
}
}
}