Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase the input block size for bgzip. #1768

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions bgzip.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include "htslib/bgzf.h"
#include "htslib/hts.h"
#include "htslib/hfile.h"
#include "hfile_internal.h" // for hfile_set_blksize

#ifdef _WIN32
# define WIN32_LEAN_AND_MEAN
Expand Down Expand Up @@ -337,6 +338,9 @@ int main(int argc, char **argv)
return 1;
}

// Increase block size to improve throughput on fast filesystems
hfile_set_blksize(f_src, 256*1024);

if (write_fname) {
if (!exp_out_open) { // only open this file once for writing, close at the end
if ((fp = bgzf_open(write_fname, out_mode)) == NULL) {
Expand Down