Commit dc293df0 authored by Jimmy Lai's avatar Jimmy Lai

bench(render-pipeline): default full runs to capture cpu profiles

parent 7c60a8ae
......@@ -18,6 +18,7 @@ pnpm --filter=next build
## 2. End-to-end benchmark (full app render path)
This measures the full request path (`renderToHTMLOrFlight`) through `bench/next-minimal-server`.
In `scenario=full` and `scenario=all`, `--capture-cpu` defaults to `true`.
Node streams only:
......@@ -117,7 +118,6 @@ pnpm bench:render-pipeline \
--scenario=full \
--stream-mode=node \
--build-full=true \
--capture-cpu=true \
--capture-trace=true \
--capture-next-trace=true \
--json-out=bench/render-pipeline/artifacts/<run>/results.json \
......
......@@ -16,6 +16,9 @@ Run end-to-end benchmark (default stress routes):
pnpm bench:render-pipeline --scenario=full --stream-mode=both
```
For `scenario=full` and `scenario=all`, CPU profiles are captured by default.
Disable with `--capture-cpu=false` if you want lower-overhead runs.
Skip rebuild for faster iteration (after you already built once):
```bash
......@@ -39,7 +42,6 @@ Capture CPU profiles + Node trace events + Next trace logs:
pnpm bench:render-pipeline \
--scenario=full \
--stream-mode=both \
--capture-cpu=true \
--capture-trace=true \
--capture-next-trace=true
```
......
......@@ -378,7 +378,12 @@ async function main() {
if (!webAnalysis && !nodeAnalysis) {
console.log('\nNo CPU profiles found in this artifact run.')
console.log('Run benchmark with --capture-cpu=true first.')
console.log(
'This analyzer reads only <mode>/<mode>.cpuprofile artifacts (not trace-event JSON or next-runtime-trace.log).'
)
console.log(
'Run benchmark with --capture-cpu=true, e.g. pnpm bench:render-pipeline --scenario=full --stream-mode=node --capture-cpu=true'
)
return
}
......
......@@ -174,7 +174,7 @@ Full benchmark options:
--timeout-ms=<number> (default: 30000)
Profiling and trace options:
--capture-cpu=true|false (default: false)
--capture-cpu=true|false (default: true for scenario=full|all, false for scenario=micro)
--capture-heap=true|false (default: false)
--capture-trace=true|false (default: false)
--capture-next-trace=true|false (default: true)
......@@ -247,6 +247,8 @@ function parseCli(): CliOptions {
const routes = parseRoutes(args.get('routes'))
const buildFull = parseBoolean(args.get('build-full') ?? 'true')
const defaultCaptureCpu =
scenarioRaw === 'full' || scenarioRaw === 'all' ? 'true' : 'false'
const shouldForceBuildFull =
(scenarioRaw === 'full' || scenarioRaw === 'all') &&
streamModeRaw === 'both' &&
......@@ -273,7 +275,7 @@ function parseCli(): CliOptions {
timeoutMs: parseNumberArg(args, 'timeout-ms', 30_000),
port: parseNumberArg(args, 'port', 3199),
captureCpu: parseBoolean(args.get('capture-cpu') ?? 'false'),
captureCpu: parseBoolean(args.get('capture-cpu') ?? defaultCaptureCpu),
captureHeap: parseBoolean(args.get('capture-heap') ?? 'false'),
captureTrace: parseBoolean(args.get('capture-trace') ?? 'false'),
captureNextTrace: parseBoolean(args.get('capture-next-trace') ?? 'true'),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment