docs: 添加 Rustdoc 注释

This commit is contained in:
2026-08-05 21:46:47 +08:00
parent 7c8f19f61a
commit 263fd255b6
158 changed files with 1440 additions and 15 deletions
+11
View File
@@ -1,8 +1,17 @@
//! Benchmark 子系统:支持 JS 压力测试(`js`)、Rust 原生 bench(`rust`)
//! 与内存泄漏检测(`leak`),并附带基线保存/回归对比功能。
/// 基准持久化与回归对比。
pub mod baseline;
/// JS 压力测试执行。
pub mod js_stress;
/// 内存泄漏检测。
pub mod leak_detect;
/// 指标采集结构。
pub mod metrics;
/// 结果格式化输出。
pub mod output;
/// Rust 原生 benchmark 委托。
pub mod rust_bench;
use std::process::ExitCode;
@@ -11,6 +20,7 @@ use std::sync::Arc;
use oxide_kernel::kernel::KernelCore;
use oxide_vm::vm_pool::VmPool;
/// 一次 bench 运行的全部配置(来自 CLI `bench` 子命令参数)。
pub struct BenchConfig {
pub mode: String,
pub filter: Option<String>,
@@ -21,6 +31,7 @@ pub struct BenchConfig {
pub leak_check_interval: usize,
}
/// 按 mode 分派到具体 benchmark 实现(js/rust/leak)。
pub fn run_benchmarks(config: BenchConfig, kernel: Arc<KernelCore>, pool: Arc<VmPool>) -> ExitCode {
match config.mode.as_str() {
"js" => js_stress::run_js_stress_bench(&config, &kernel, &pool),