Files
marqdo-cli/docs/evidence/2026-11-20-p6-profile.md
T
cflmy 4c8e7fd8ab perf(p6): add a reproducible baseline profile harness
- tools/perf/bench.py builds the release CLI and measures 7 .mq.md workloads
  three times with wall time and peak RSS, validating --json success.
- Check in the schema-tagged JSON report and interpretation; no bytecode/JIT/
  native backend was added, so P6 remains baseline-only, not complete.
- Update STATUS/changelog/tests README.

Gate: fmt, clippy -D warnings, 430 tests passed.
2026-11-20 23:16:02 +08:00

54 lines
2.0 KiB
Markdown

# RFC-CM P6 baseline profile
Date: 2026-11-20 (Asia/Shanghai)
Repository: `marqdo-cli`
Baseline: `b020904` plus this step's changes.
Scope: **baseline measurement only**; no bytecode/JIT/native backend was added.
## Harness
`tools/perf/bench.py` builds `marqdo-cli --release`, runs each workload three
times through `/usr/bin/time -f "%e %M"`, measures wall time with
`time.perf_counter`, verifies `--json` success and writes a schema-tagged JSON
report. The checked-in report is
[`2026-11-20-p6-profile.json`](2026-11-20-p6-profile.json).
Environment: Ubuntu 26.04 container, Linux x86_64, Rust 1.100.0, release
profile, 7 selected `.mq.md` workloads. These are small conformance workloads,
so most times are dominated by process/startup and Markdown parsing; they are
not throughput benchmarks of large scientific problems.
## Results (median of 3)
| Workload | Wall s | Peak RSS KiB |
|---|---:|---:|
| allocator-free-list | 0.0173 | 8428 |
| json-parser | 0.0188 | 8960 |
| table-sort | 0.0152 | 7476 |
| bytecode-vm | 0.0155 | 7692 |
| matrix-multiply | 0.0151 | 7368 |
| http-parser | 0.0180 | 8196 |
| stdlib-print-demo | 0.0205 | 9636 |
## Interpretation
* Startup + parse + load dominate these small workloads; the interpreter's
per-byte/per-call cost is visible mainly in the VM/matrix/table loops.
* `stdlib-print-demo` is highest RSS/wall because it loads the bundled stdlib
modules and formats all value types through `.mq.md`.
* The current release binary is a tree-walking Rust interpreter; no bytecode
compiler, JIT, columnar numeric backend or copy-elision pass exists.
* No claim of P6 pass: the RFC requires an optimized implementation that is
equivalent to the reference interpreter and reproducible performance/budget
evidence. This report only establishes the baseline and a reproducible
harness for future work.
## Reproduce
```bash
export PATH=/root/.cargo/bin:$PATH
export CARGO_HOME=/root/work/marqdo-cli/.cache/cargo
export CARGO_TARGET_DIR=/root/work/marqdo-cli/.cache/target
python3 tools/perf/bench.py > /tmp/marqdo-perf.json
```