Skip to content

perf(fspy): report accesses over pipe sockets - #586

Draft
wan9chi wants to merge 3 commits into
agent/reapply-runner-fifofrom
agent/fspy-pipe-socket
Draft

perf(fspy): report accesses over pipe sockets#586
wan9chi wants to merge 3 commits into
agent/reapply-runner-fifofrom
agent/fspy-pipe-socket

Conversation

@wan9chi

@wan9chi wan9chi commented Aug 3, 2026

Copy link
Copy Markdown
Member

Motivation

Measure the performance cost of replacing fspy's shared-memory record channel with the pipe_socket transport introduced by #569. This stacked experiment lets the existing fspy benchmark workflow compare both implementations side by side on Linux, macOS, and Windows.

Implementation

  • Remove the shared-memory sender, receiver, and frame reader/writer from the fspy path.
  • Give each target thread a lazy pipe-socket client with a reusable frame buffer. Normal fork children reconnect, while transient pre-exec children leave inherited clients untouched so remapped process descriptors are preserved.
  • Run one buffered supervisor reader per accepted connection and store decoded records in per-connection arenas.
  • When the root target exits, stop accepting connections, reject later clients, and drain every accepted connection to EOF before returning. On Windows, a separate liveness pipe lets late clients fail while accepted data connections are still draining.
  • Cover concurrent target threads and the supervisor shutdown contract.

Local measurements

Measured on an Apple M5 Pro running macOS 27.0, using release builds and Outline b2b41dd3 with Oxlint 1.75.0:

oxlint --type-aware app server shared plugins
18 interleaved samples, cycling all six arm orderings

new tracked          median 2.864s  IQR 2.698s..2.893s
main tracked         median 2.741s  IQR 2.667s..2.834s
untracked            median 2.765s  IQR 2.696s..2.832s

new vs main          median +1.8%  IQR +0.7%..+3.6%
new vs untracked     median +1.6%  IQR -0.6%..+3.4%
main vs untracked    median -1.1%  IQR -3.2%..+1.6%

A counted run captured 47,695 raw access records through the pipe transport. The repository's synthetic head-vs-untracked benchmark reports dynamic/launch +153.91% and dynamic/access +115.09%.

CI measurements

Here, change compares this pipe-socket branch with #569's shared-memory implementation; overhead compares this branch with untracked execution.

linux
dynamic/launch    change  +5.07% [ +0.34% .. +10.81%]  overhead  +52.81%
dynamic/access    change +52.90% [+49.43% .. +63.14%]  overhead +135.64%
static/launch     change +10.70% [ +3.30% .. +19.00%]  overhead +173.72%
static/access     change  +0.18% [ -0.99% ..  +1.94%]  overhead +822.57%

macos
dynamic/launch    change  +1.77% [ -3.34% ..  +7.79%]  overhead +233.34%
dynamic/access    change +63.82% [+36.84% .. +79.38%]  overhead  +98.23%

windows
dynamic/launch    change  -9.84% [-15.09% ..  -3.69%]  overhead  +18.38%
dynamic/access    change +26.69% [+24.96% .. +27.65%]  overhead  +37.41%

The access-heavy dynamic case regresses materially on every platform, while dynamic launch is near noise on Linux/macOS and improves on Windows. Full CI report: benchmark comment.

Co-authored-by: GPT-5 Codex <codex@openai.com>

wan9chi commented Aug 3, 2026

Copy link
Copy Markdown
Member Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

fspy benchmark

linux

dynamic/launch             change  +5.07%  [ +0.34% .. +10.81%]  overhead   +52.81%
dynamic/access             change +52.90%  [+49.43% .. +63.14%]  overhead  +135.64%
static/launch              change +10.70%  [ +3.30% .. +19.00%]  overhead  +173.72%
static/access              change  +0.18%  [ -0.99% ..  +1.94%]  overhead  +822.57%

macos

dynamic/launch             change  +1.77%  [ -3.34% ..  +7.79%]  overhead  +233.34%
dynamic/access             change +63.82%  [+36.84% .. +79.38%]  overhead   +98.23%

windows

dynamic/launch             change  -9.84%  [-15.09% ..  -3.69%]  overhead   +18.38%
dynamic/access             change +26.69%  [+24.96% .. +27.65%]  overhead   +37.41%

wan9chi and others added 2 commits August 3, 2026 20:08
Co-authored-by: GPT-5 Codex <codex@openai.com>
Co-authored-by: GPT-5 Codex <codex@openai.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