perf(pragmastat): more perf tweaks#3595
Merged
jqnatividad merged 3 commits intomasterfrom Mar 9, 2026
Merged
Conversation
Pre-compute ln() arrays once per column before the two-sample pair loop, eliminating redundant O(n) log passes (k=10 cols: 10 passes vs 90). Add indexed parallel CSV reading for large files (>=10k rows) using ThreadPool + crossbeam_channel, following the moarstats.rs pattern. Falls back to sequential reading for stdin or small files. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…rrors Chunks from parallel CSV reading were merged in arrival order rather than chunk index order, which could scramble row ordering. Now sends chunk_idx with results and sorts before merging. Also propagates an error instead of silently returning empty data when the index fails to open. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Improves qsv pragmastat performance by adding an indexed, multi-threaded CSV read path for large inputs and reducing repeated log-transform work during two-sample ratio calculations.
Changes:
- Add an indexed + chunked parallel CSV ingestion path for large files.
- Precompute per-column log-transformed values once and reuse them across two-sample pairs.
- Refactor two-sample computation to accept optional precomputed log slices.
Propagate the --no-headers flag to per-chunk Config in the parallel CSV reading path, fixing incorrect seek positions when headers are disabled. Add two integration tests exercising the parallel path (>=10k rows): pragmastat_parallel_reading and pragmastat_parallel_reading_no_headers. Addresses Copilot review feedback on PR #3595. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
No description provided.