Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: oven-sh/bun/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. WalkthroughThe CPU profiler options table now includes ChangesCPU profiler documentation
Suggested reviewers: Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The documented default and example match the profiler behavior; no material merge-readiness risk remains. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 1 system. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Comment |
`bun --help` lists `--cpu-prof-interval` (sampling interval in microseconds, default 1000), but the flag table in docs/project/benchmarking.mdx did not. Add a row and an example. Prettier realigned the other rows of the table.
32ef0c1 to
458467d
Compare
What does this PR do?
Part of #44077. The profiler fix for that issue is in #44078. This PR covers only the docs gap that the issue notes at the end.
bun --helplists--cpu-prof-interval("Specify the sampling interval in microseconds for CPU profiling (default: 1000)"). The options table under "CPU profiling" indocs/project/benchmarking.mdxdoes not list it. The heap profiling table on the same page lists--heap-prof-interval.This PR adds:
--cpu-prof-interval <microseconds>: "Set sampling interval (default: 1000)"bun --cpu-prof --cpu-prof-interval 500 script.jsbun run prettierrealigned the table, so the other rows change only in padding.The CLI reference page
docs/snippets/cli/run.mdxis not changed here, because the open PR #43044 adds--cpu-prof-intervalto it.How did you verify your code works?
Docs only, so there is no test change. I checked the page against
--helpand the implementation, and ran each example as written. The runs used a debug build of mainf063852e5,1.4.3-canary.1+f063852e5and1.4.2+744846f84on macOS arm64.Default. The docs,
--helpand the code all give 1000:CpuProf::default()insrc/options_types/context.rssetsinterval: 1000,src/runtime/cli/Arguments.rsfalls back to 1000 when the value does not parse, ands_samplingIntervalinBunCPUProfiler.cppstarts at 1000.Examples. All three commands in the Options block exit 0, and each writes one
.cpuprofile.Behavior, 200 ms busy loop,
--cpu-prof. Samples in every run I logged, in run order:--cpu-prof-interval 1000--cpu-prof-interval 500At 500, six of the nine runs took 303 to 308 samples. The other three took 268, 206 and 253, and their median gap between samples was 0.73 to 0.84 ms, against 0.64 to 0.66 ms in the six. Every run took more samples at 500 than with no flag, 1.35 to 2.01 times as many. The logged load averages around these runs were 6 to 12.
--cpu-prof-md --cpu-prof-interval 500shows500usin the header's Interval column.Formatting.
bun run prettierchanged only this file.Rendering.
Bun.markdown.htmlrenders the section's table with five rows. I did not run a Mintlify preview.