Repository navigation
Filter records before building per-record sink futures - #266
Merged
Merged
Conversation
ReorderSink and BufferingDecoderSink built and awaited one handle() future per batch record before checking wants(). The futures embed the commit and decode paths' state, so each was a large memmove even for records the sink skips: ReorderSink wants only xact records, about 15% of the lifecycle benchmark's WAL. Checking first cut the memmove share of the serial queue worker from 7.2% to 4.9%. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
serprex
force-pushed
the
split/sink-prefilter
branch
from
October 23, 2026 14:16
94b0522 to
bc7c82d
Compare
harshil-goel
approved these changes
Oct 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Batch dispatch constructs large per-record futures before sinks reject unwanted records. Check wants() before building reorder and decoder futures. Preserve batch order and final shipment.
Extracted from original #228 and based directly on
main. Contains no changes from #226 or other extracted PRs.Validation:
cargo fmt --all -- --check,cargo clippy --workspace --all-targets --locked -- -D warnings, andcargo test --locked --lib emit::pipeline::reorder(5 passed). Rebuild crate for each isolated diff.Measured impact (2026-10-22)
Compared
94b0522c90d2a9eae36222faad6e7b045236386cagainst shared parent151fd47cbd75ec7b9bc63ffe7040f049e702ecd0, with each PR built separately.Workload: 20,000 batches of 512 unwanted records (10,240,000 records), sent directly through production
BufferingDecoderSink::on_records, with empty predecode slice and empty descriptor logs. Check successful dispatch. Measures decoder prefilter path; reorder sink, accepted heap records, mixed batches, and end-to-end throughput remain unmeasured.AMD Ryzen 7 7840U; rustc 1.99.1; locked dependencies; optimized release builds; mimalloc 0.1.52. Seven trials per revision, alternating base/PR order, pinned to CPUs 2,4,6 (three physical cores). Values show median [min, max]; negative time changes mean less work or waiting. Local component measurements, without PostgreSQL or ClickHouse services.