Skip to content

perf(gateway): batch worker text and streamline pull request reads - #988

Merged
nixuuu merged 4 commits into
devfrom
perf/batch-worker-events
Nov 18, 2026
Merged

nixuuu merged 4 commits into
devfrom
perf/batch-worker-events

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 18, 2026

Copy link
Copy Markdown
Member

Changes

  • Commit consecutive buffered text deltas for the same worker thread and turn together, up to 32 events and 256 KiB of text and raw JSON. The first delta following a control message proceeds immediately. Publish individual events in order and acknowledge committed journal prefixes. Retry failed groups per event.
  • Start PR file-page and Viewed reads concurrently through the existing GitHub request scheduler. Verify mutable REST data before caching it and verify head, base and account mapping before returning the result.
  • Reserve capacity for process, queue and ACK measurements within existing collector and snapshot memory limits. Export window boundaries, sanitized loss reasons and per-link losses. Omit inapplicable statistics and exclude events without a receipt timestamp from ACK latency.
  • Give each PostgreSQL test server an IPC-linked helper that can remove its own container and volume after the runner exits. Removal targets the full Docker ID. Existing containers are outside its scope.

Local verification

  • In three runs per mode against a local PostgreSQL/gRPC fixture, the median 160-event burst required 9 transcript transactions and ACKs with batching versus 160 before. Median run p95 for burst send to ACK fell from 638 ms to 186 ms. Time to first gateway publication was 18.1 ms before and 17.4 ms after. These timings describe the fixture.
  • With a cached PR summary, the 300-file GitHub fixture required one upstream summary request on a warm file-page read, down from three. The cold read issued one REST page request, three Viewed requests and two summary checks. Tests cover head/base changes and account remapping mid-read.
  • Targeted tests covered bounded event batches, mixed frames, retry and quarantine, journal replay, live thread updates, durable threads, owner-scoped PR reads, cache behavior, collector pressure, memory bounds, export, durable diagnostics history and schema setup. Temp-directory checks passed.
  • Verified interruption during PostgreSQL setup with two concurrent fixtures. Killing the first runner removed only its database container. Terminating the second removed its container too.
  • Gateway, transport and database package typechecks passed, as did lint and formatting for the edited TypeScript. Repository-wide static checks, test shards and platform builds run in GitHub CI.

Fixes: #523
Fixes: #535
Fixes: #569

@nixuuu
nixuuu enabled auto-merge (squash) November 18, 2026 20:03
@nixuuu
nixuuu merged commit bad181c into dev Nov 18, 2026
27 of 29 checks passed
@nixuuu
nixuuu deleted the perf/batch-worker-events branch November 18, 2026 20:42
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