Skip to content

perf(pragmastat): more perf tweaks#3595

Merged
jqnatividad merged 3 commits intomasterfrom
pragmastat-more-perf
Mar 9, 2026
Merged

perf(pragmastat): more perf tweaks#3595
jqnatividad merged 3 commits intomasterfrom
pragmastat-more-perf

Conversation

@jqnatividad
Copy link
Collaborator

No description provided.

jqnatividad and others added 2 commits March 9, 2026 13:32
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>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@jqnatividad jqnatividad merged commit ba49129 into master Mar 9, 2026
16 checks passed
@jqnatividad jqnatividad deleted the pragmastat-more-perf branch March 9, 2026 18:06
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.

2 participants