diff --git a/README-zh.md b/README-zh.md index 1776aa7..e094479 100644 --- a/README-zh.md +++ b/README-zh.md @@ -66,7 +66,9 @@ cargo test --workspace cargo fmt --check --all cargo clippy --workspace -- -D warnings -# 运行基准测试(首次运行会生成约 5GB 测试文件) +# 运行基准测试(需要先生成约 5GB 测试文件) +mkdir -p /tmp/test-logviewer +dd if=/dev/urandom of=/tmp/test-logviewer/extreme.log bs=1M count=5000 cargo run -p log-viewer-bench cargo run -p log-viewer-bench -- --quick --suites startup,render --output results.md @@ -102,4 +104,6 @@ CI 在 ubuntu-latest 和 windows-latest 上运行以下检查: 自研基准测试框架,对比 mmap 与 pread 两种后端在 7 个测试场景(启动、渲染、跳转、内存、增长、轮转、并发)下的表现。使用挂钟计时和 `/proc/self/` 的 RSS 及页错误指标。结果以 Markdown 表格形式输出到 `benchmark-report.md`。 +基准测试框架要求 `/tmp/test-logviewer/extreme.log` 已经存在。它不会自动生成主用的 5GB 测试文件;请先使用上方的 `dd` 命令创建。 + 基准测试二进制包含约 75 个单元测试,覆盖读取器后端和指标采集逻辑。 diff --git a/README.md b/README.md index c89b788..59968a2 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,9 @@ cargo test --workspace cargo fmt --check --all cargo clippy --workspace -- -D warnings -# Run benchmarks (generates ~5GB test file on first run) +# Run benchmarks (requires a pre-generated ~5GB test file) +mkdir -p /tmp/test-logviewer +dd if=/dev/urandom of=/tmp/test-logviewer/extreme.log bs=1M count=5000 cargo run -p log-viewer-bench cargo run -p log-viewer-bench -- --quick --suites startup,render --output results.md @@ -101,4 +103,6 @@ Planned but not yet built: filtering, bookmarks, sessions, search engine (stub m Custom harness comparing mmap vs pread backends across 7 suites (startup, render, jump, memory, growth, rotation, concurrent). Uses wall-clock timing with `/proc/self/` RSS and page fault metrics. Results are written as markdown tables to `benchmark-report.md`. +The harness expects `/tmp/test-logviewer/extreme.log` to already exist. It does not generate the primary 5GB test file automatically; create it first with the `dd` command shown above. + The benchmark binary includes ~75 unit tests for the reader backends and metrics collection.