docs: clarify benchmark test file setup

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
dailz
2026-06-30 16:54:46 +08:00
co-authored by Sisyphus
parent ef26481976
commit 0910d4e85f
2 changed files with 10 additions and 2 deletions
+5 -1
View File
@@ -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 个单元测试,覆盖读取器后端和指标采集逻辑。
+5 -1
View File
@@ -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.