Skip to content

fix(cpu-profile): unique cpuprofile names + diagnostic logging#110

Merged
JohnMcLear merged 1 commit into
mainfrom
fix/cpu-profile-pid-suffix
May 16, 2026
Merged

fix(cpu-profile): unique cpuprofile names + diagnostic logging#110
JohnMcLear merged 1 commit into
mainfrom
fix/cpu-profile-pid-suffix

Conversation

@JohnMcLear

Copy link
Copy Markdown
Member

Run 25956064101 captured the cross-env wrapper's boot profile because both the wrapper and the real SUT inherited NODE_OPTIONS=--cpu-prof and shared the fixed --cpu-prof-name filename. Drop the fixed name so Node uses its default pid-suffixed name (CPU.....cpuprofile), and log per-file sizes so the analyst can pick the SUT (largest file). Also capture the SUT pid in a sidecar file for unambiguous identification.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@JohnMcLear
JohnMcLear merged commit fe39657 into main May 16, 2026
4 checks passed
@JohnMcLear
JohnMcLear deleted the fix/cpu-profile-pid-suffix branch May 16, 2026 07:31
JohnMcLear added a commit that referenced this pull request May 16, 2026
The previous workflow exported NODE_OPTIONS=--cpu-prof and ran `pnpm run
prod`, producing 5 cpuprofile files (one per Node process in the
pnpm → cross-env → tsx chain). The pgrep-based SUT pid capture matched
the tsx wrapper rather than the actual server.ts process — analysis
of run 25956220071 showed pid 2636 (pnpm) blocked in spawnSync for
113s while the recorded sut pid 2684 (tsx) was 99.8% idle.

Invoke node directly with the same args the prod script uses
(`node --require tsx/cjs node/server.ts`) under --cpu-prof, set
NODE_ENV inline, and record the SUT pid via `$!` so there's exactly
one process to profile and stop. The earlier --cpu-prof-name pid-suffix
fix from PR #110 is retained.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant