Skip to content

compute: Avoid per-peer message count arrays for pipeline channels - #39882

Open
antiguru wants to merge 1 commit into
MaterializeInc:mainfrom
antiguru:mh/timely-logging-sparse-message-counts
Open

antiguru wants to merge 1 commit into
MaterializeInc:mainfrom
antiguru:mh/timely-logging-sparse-message-counts

Conversation

@antiguru

Copy link
Copy Markdown
Member

The timely logging demux allocated a dense per-peer MessageCount array per channel and direction on every worker, so its state grew with channels times workers squared across a replica. Most channels are pipeline channels where a worker only talks to itself. Channels now keep a single local count and widen to the per-peer array on the first message to or from another worker. The logged message and batch counts, and their retractions on dataflow shutdown, are unchanged.

On a local 32-worker replica with 60 indexed views over an auction load generator, 3882 of 4213 channels carrying messages were self-only. Sampled jemalloc heap held by the message count state fell from 81.5 MiB to 21 MiB.

Posted by Claude Code.

🤖 Generated with Claude Code

The timely logging demux kept, for every channel that carried a message, a
dense array of per-peer counts in each direction, so its state grew with
channels times workers squared across a replica. Most channels are pipeline
channels on which a worker only talks to itself. Track a single local count
per channel and widen to a per-peer array only once a channel carries a
message to or from another worker. Retractions on dataflow shutdown cover
the same non-zero updates as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@antiguru
antiguru marked this pull request as ready for review October 16, 2026 08:01
@antiguru
antiguru requested a review from a team as a code owner October 16, 2026 08:01

This branch has not been deployed

No deployments
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