bgzip reindex performance

Open
#378 4 comments 0 reactions 1 assignee View on GitHub

@jkbonfield is already working on this.

Since May 23, 2016.

Assessment

This issue has not been assessed yet.

Description

Hi,

I have noticed that bgzip's reindex functionally seem slower that is necessary.

The index in made up of the uncompressed and compressed offsets for each bgzip block in a file possibly excluding the final block. I think all this information is contained within the bgzip header and footer i.e. the BSIZE feild and the ISIZE field (page 11: https://samtools.github.io/hts-specs/SAMv1.pdf)

However the current implementation is passing the entire file block-wize to bgzf_read() in bgzf.c which I think is decompressing the file to rebuild the index.

Is there any reason why the reindexing functionality can be implemented by just seeking through the file and just pulling out the BSIZE and ISIZE fields?

By the way I am interested in reindex performance due to another issued I raised in parallel to this:
https://github.com/samtools/htslib/issues/377

Dominant language
C
Stars
950
Forks
475
Avg merge
3d 13h
Merged PRs (30d)
11

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from samtools/htslib

All issues in samtools/htslib

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.