Skip to content

sort: add --threads and phase-timing output - #2591

Merged
pd3 merged 3 commits into
samtools:developfrom
hiruna72:sort_threads
Sep 30, 2026
Merged

pd3 merged 3 commits into
samtools:developfrom
hiruna72:sort_threads

Conversation

@hiruna72

Copy link
Copy Markdown
Contributor

Adds --threads INT to bcftools sort, threading the final merge-to-output BGZF/BCF compression (same convention as view/concat/norm: compression of the output stream only). Also adds phase 1 / phase 2 elapsed-time lines on stderr (sort-to-temp-files vs. final-merge-and-write), using the same gettimeofday pattern already used in vcfconcat.c/vcfgtcheck.c.

Motivation: sorting very large VCFs was bottlenecked on the single-threaded final write. On a 333MB/382k-record real SV VCF, --threads 8 cut phase 2 from 37.2s to 9.4s (output verified byte-identical to the unthreaded run). Full test suite passes, no new failures.

Assisted-by: Claude:claude

@hiruna72
hiruna72 marked this pull request as ready for review September 14, 2026 22:42
@pd3
pd3 merged commit f91b859 into samtools:develop Sep 30, 2026
16 checks passed
@pd3

pd3 commented Sep 30, 2026

Copy link
Copy Markdown
Member

Thank you for the pull request

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