Skip to content

flowctl: parse fixture lines once and prepare them on worker threads - #3446

Open
mdibaiee wants to merge 2 commits into
masterfrom
mahdi/preview-next-fixture-feeder
Open

flowctl: parse fixture lines once and prepare them on worker threads#3446
mdibaiee wants to merge 2 commits into
masterfrom
mahdi/preview-next-fixture-feeder

Conversation

@mdibaiee

Copy link
Copy Markdown
Member

Description:

The preview-next fixture feeder parsed every line into a serde_json::Value twice, cloned it, rebuilt it as a HeapNode, validated and keyed it, all on one task. Feeding a 25M-document transaction took ~123s on a 22-core machine, and every shard of a multi-shard preview waited on it.

  • Lines are parsed once, straight into a HeapNode with simd-doc; the synthetic UUID is set on the heap node; one bump allocator is reused. is_commit_line only parses lines that can be a marker.
  • Streamed lines are batched and prepared on worker threads (parse, stamp, archive, validate, key, route), then pushed in fixture order, so blocks and clocks match the serial feeder.
  • --fixture-validate=false skips schema validation for documents known to be valid, such as generated benchmark fixtures.

Same machine, same transaction: 123s → 96s (single parse) → 82s (no validation) → 46–52s (workers).

Workflow steps:

flowctl raw preview-next --fixture ... [--fixture-validate=false]. Output is unchanged.

Documentation links affected:

None.

Notes for reviewers:

Mahdi Dibaiee added 2 commits August 30, 2026 11:58
…ows a segment

Blocks above the writer's compress threshold are already LZ4-compressed, so
compressing a whole sealed segment can grow it. The reclaim stream then credits
the larger size on unlink, more than was charged when the segment rolled, and
the checked subtraction panicked. Any connector slower than COMPRESS_AFTER per
transaction hit it.

Closes #3443
The preview-next fixture feeder parsed each line into a serde_json::Value
twice, cloned it, rebuilt it as a HeapNode, validated and keyed it, all on
one task. Lines now parse once, straight into a HeapNode, and streamed lines
are batched and prepared on worker threads, then pushed in fixture order so
blocks and clocks are unchanged. --fixture-validate=false skips schema
validation for documents known to be valid.

Feeding a 25M-document transaction on a 22-core machine: 123s to 46-52s.
jacobmarble
jacobmarble previously approved these changes Aug 31, 2026
Base automatically changed from mahdi/preview-next-fixture-backlog-underflow to master August 31, 2026 22:25
@mdibaiee
mdibaiee dismissed jacobmarble’s stale review August 31, 2026 22:25

The base branch was changed.

@jgraettinger

jgraettinger commented Aug 31, 2026

Copy link
Copy Markdown
Member

Please hold off on merging this, until this code refactor move lands? #3416

@mdibaiee

Copy link
Copy Markdown
Member Author

@jgraettinger okay 👍🏽

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.

3 participants