Skip to content

Buffer receive-pack reference advertisements - #125

Open
znull wants to merge 2 commits into
mainfrom
receivepack-buffered-advertisement
Open

Buffer receive-pack reference advertisements#125
znull wants to merge 2 commits into
mainfrom
receivepack-buffered-advertisement

Conversation

@znull

@znull znull commented Aug 13, 2026

Copy link
Copy Markdown

Reference discovery writes each advertised ref as a separate pkt-line header and payload. When the caller hands spokes-receive-pack a TCP socket directly, that creates millions of tiny socket writes.

This change buffers only the reference-advertisement phase through its terminating flush packet. The legacy non-isolated discovery pipeline starts collectors concurrently, so their shared capability decision and complete pkt-line writes are serialized to preserve framing.

Benchmarking and tracing shows reduced spokes writes from ~11.0M to ~8.8k and client reads from ~7.1M to ~90k for the benchmark window.

Reference discovery emits each pkt-line as separate header and payload
writes. Buffer discovery up through its terminating flush packet, and
serialize the legacy concurrent collectors so direct socket transports
still have coherent packet framing.
@znull znull self-assigned this Aug 13, 2026
git's next branch now builds libgitcore with rust.
@znull
znull marked this pull request as ready for review August 13, 2026 18:59
Copilot AI balanced review requested due to automatic review settings August 13, 2026 18:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Buffers reference advertisements to reduce socket writes while preserving pkt-line framing across concurrent collectors.

Changes:

  • Buffers and flushes reference discovery output.
  • Serializes legacy concurrent advertisement writes.
  • Adds buffering/concurrency tests and installs Cargo in CI.
Show a summary per file
File Description
internal/spokes/spokes.go Implements buffered, synchronized reference advertisement.
internal/spokes/spokes_test.go Tests both discovery paths and concurrent collectors.
.github/workflows/go-test.yml Adds Cargo required for the Git build.

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Balanced

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.

2 participants