Repository navigation
Conversation
Records are parsed and owned on the pump thread, so every block and main data buffer the serial queue worker dropped was a cross-thread mimalloc free, about 6% of the worker's cycles on the lifecycle benchmark. The worker is the stage the pump waits on, so hand each finished batch to the blocking pool to drop instead; one spawn per 512 records costs far less than the frees it moves. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
seems inconclusive, have doubts re overhead of spawning tasks |
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.
Queue worker frees pump-allocated record payloads across threads after each batch. Move completed batch destruction onto blocking pool so frees no longer occupy serial dispatch stage.
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 source::queueing_record_sink(15 passed). Rebuild crate for each isolated diff.Measured impact (2026-10-22)
Compared
f9168a30a0160ec60ee2800ece162953fe7771c2against shared parent151fd47cbd75ec7b9bc63ffe7040f049e702ecd0, with each PR built separately.Workload: 262,144 records per case through production
QueueingRecordSink, no-op downstream batch sink, batch size 512, capacity 131,072, two Tokio runtime workers. Timed scope includes record/payload allocation, dispatch, close, and runtime shutdown, which waits for detached blocking frees. RSS covers complete matrix, including skipped-record controls; it is not per-case retained memory.Result: no consistent dispatch gain in this workload. Position-only cost increased 68.6%; median peak RSS increased 70.0%. Wanted-record timing ranges overlap across revisions.
Detached destruction adds a blocking-pool submission for every completed batch, including empty position-only batches. Queue depth decrements before destruction finishes, so pending free jobs retain memory outside queue accounting. These measurements isolate dispatch/free costs; a decoder-bound production workload may behave differently.
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.