-
Notifications
You must be signed in to change notification settings - Fork 53
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
noodles implementation is slower than rust-htslib, did I do something suboptimal? #218
Comments
this is on a macbook arm64 computer. |
noodles tends to do more record validation and tries to ensure data is spec compliant. However, in your flamegraphs, it seems the DEFLATE implementation htslib linked to is using SIMD intrinsics (see Can you retime your tests using libdeflate for both? I.e., |
If you don't need owned records, you can reuse the record buffer. let mut record = sam::alignment::Record::default();
while bam_reader.read_record(&header, &mut record)? != 0 {
// ...
} When doing this, you may also want to use |
noodles 0.61.0 now allows alignment format records to read and written, but I'm not sure if this will help in a passthrough case like in your tests. Feel free to open a new discussion if you have any further questions. |
rust-htslib:
noodles:
i first implemented with htslib, then tried switching to noodles with no architectural changes.
![image](https://private-user-images.githubusercontent.com/61636/285625727-de17e711-db87-49e5-8779-06655976873f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjEzNDA4MzAsIm5iZiI6MTcyMTM0MDUzMCwicGF0aCI6Ii82MTYzNi8yODU2MjU3MjctZGUxN2U3MTEtZGI4Ny00OWU1LTg3NzktMDY2NTU5NzY4NzNmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzE4VDIyMDg1MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTVjMDBhYzJmNTY5ZjQ1ZmU0NjM1ZmZlY2ViNDY2NDNiZTQ1N2YxZTgyNTYzZDFmNTllZTcyOTRlMmRiMTRiMjImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.Q11SPEtuvOExZKihmZJkm8Iv80Rq3oF5UtHemnd1Wdo)
for noodles i'm opening like this:
for htlslib like this:
The internal filtering logic is the same , reasoning about flags insert size , etc - writing out some records.
Any suggestions?
The text was updated successfully, but these errors were encountered: