Skip to content

feat: track spawned processes (execve count) per variation#69

Merged
darcyclarke merged 1 commit intovltpkg:mainfrom
vltbaudbot:feat/spawned-process-count
Mar 11, 2026
Merged

feat: track spawned processes (execve count) per variation#69
darcyclarke merged 1 commit intovltpkg:mainfrom
vltbaudbot:feat/spawned-process-count

Conversation

@vltbaudbot
Copy link
Contributor

Adds a new Spawned Processes data point that counts the number of processes each package manager spawns (via execve syscalls) during install. This varies by state/variation, so it's captured for each one — just like package count data.

How it works

After the hyperfine benchmark completes for each variation, a separate strace run is performed for each PM under the same state:

  1. scripts/process-count.sh — wraps a single install with strace -f -e trace=execve, counts execve() calls in the output
  2. scripts/collect-process-count.js — aggregates per-PM counts into process-count.json (same format as package-count.json: { "npm": { "count": 42 }, ... })
  3. collect_process_count() in common.sh — orchestrates the strace runs, using the variation's BENCH_PREPARE_BASE + per-PM setup commands to replicate the correct state

The strace run is separate from the timed benchmark so it doesn't affect timing measurements.

Backend

  • New scripts: process-count.sh, collect-process-count.js
  • common.sh: extracted bare BENCH_INSTALL_* commands (no log redirection) for reuse by both hyperfine and strace; added collect_process_count()
  • All 8 standard variation scripts (clean, cache, lockfile, node_modules, combos): call collect_process_count after collect_package_count
  • process-results.sh: copies process-count.json to dated + latest results
  • setup.sh: ensures strace is installed

Frontend

  • New types: ProcessCountData, ProcessCountTableRow
  • New hook: use-process-count-data.ts (fetches /latest/<fixture>-<variation>-process-count.json)
  • New component: ProcessCountTable — sortable table with Terminal icon, locale-formatted numbers
  • Integrated into variation page below the Package Count Data section
  • New utility: getAvailablePackageManagersFromProcessCount

Notes

  • Currently scoped to the 8 standard install variations (same scope as package count). Registry and run variations are not included yet.
  • If strace is unavailable, the collection step is silently skipped (no-op).
  • The strace log files are cleaned up after counting to save disk space.

Add a new 'Spawned Processes' data point that counts the number of
processes each package manager spawns (via execve syscalls) during
install. This is captured per-variation since different states (clean,
cache, lockfile, etc.) may produce different process counts.

## How it works

After each benchmark completes, a separate strace run is performed for
each package manager under the same variation state:

1. `process-count.sh` — wraps a single install with
   `strace -f -e trace=execve` and counts execve() calls
2. `collect-process-count.js` — aggregates per-PM counts into
   `process-count.json` (same format as package-count.json)
3. `collect_process_count` in common.sh — orchestrates the strace
   runs for all included PMs using BENCH_PREPARE_BASE + setup commands

The strace run is separate from the timed benchmark to avoid overhead.

## Backend changes

- `scripts/process-count.sh` — new: strace wrapper per PM
- `scripts/collect-process-count.js` — new: aggregation script
- `scripts/variations/common.sh` — extracted bare BENCH_INSTALL_*
  commands (no log redirects) for reuse; added collect_process_count()
- All 8 standard variation scripts — call collect_process_count
- `scripts/process-results.sh` — copy process-count.json to results
- `scripts/setup.sh` — ensure strace is installed

## Frontend changes

- `ProcessCountData` / `ProcessCountTableRow` types
- `use-process-count-data.ts` hook (mirrors use-package-count-data)
- `ProcessCountTable` component with Terminal icon, sortable columns,
  locale-formatted numbers
- Integrated into variation page below Package Count Data
- `getAvailablePackageManagersFromProcessCount` utility
@darcyclarke darcyclarke merged commit a7aab6c into vltpkg:main Mar 11, 2026
1 check failed
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.

3 participants