Skip to content

reverse_complement: Pre-allocate a buffer based on input size #44

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

Merged
merged 1 commit into from
Feb 24, 2017

Conversation

mbrubeck
Copy link
Contributor

Fixes #43. This speeds up reverse_complement < input25000000.txt by about 40% on my system.

@TeXitoi
Copy link
Owner

TeXitoi commented Feb 24, 2017

Great work! Please add your name in the contributors.

let cur = f.seek(SeekFrom::Current(0))?;
let end = f.seek(SeekFrom::End(0))?;
f.seek(SeekFrom::Start(cur))?;
Ok(end as usize + 1)
Copy link
Owner

Choose a reason for hiding this comment

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

Does f.metadata()?.len() works?

@mbrubeck
Copy link
Contributor Author

Does f.metadata()?.len() works?

Yes, it does. Thanks! Fixed to use metadata() and added my name.

@TeXitoi TeXitoi merged commit e1681f9 into TeXitoi:master Feb 24, 2017
@TeXitoi
Copy link
Owner

TeXitoi commented Feb 24, 2017

https://alioth.debian.org/tracker/index.php?func=detail&aid=315633&group_id=100815&atid=413122 Thanks again for these contributions! Waiting the next ones ;-)

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