| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| # track length before and after | ||
| var before = len(self.seq) | ||
| var _want = want | ||
| var _total = self.reader.read_bytes(self.seq, _want) |
There was a problem hiding this comment.
What if here we did var _total = self.reader.read_bytes(self.seq, _want, keep=True)?
You'd have to adjust the byte math to subtract one. But it avoids an extra read call, which might be nice.
Sorry, something went wrong.
There was a problem hiding this comment.
That's not read_until! So just _want + 1?
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Stabilizing fastxpp Benchmarks
I had AI summarize my messy notes and hyperfine results. Everything seems to be correct.
This is follow up to #14 where there were some inconsistent results.
TL,DR
By holding benchmarking scaffolding static with @no_inline and selectively forcing inlining on the hottest helpers, we:
Motivation
The existing benchmark numbers have been noisy, likely because the compiler optimizes the benchmark harness together with the implementation under test. This obscures the real cost of each I O strategy. We want numbers that:
Header field definition (for now)
How do we calculate the last line (if we wanted to)?
Different read methods for fastxpp
The methods are named terribly sorry, ill change latter.
There are 4 key steps
1: Identify record start ('>')
2: Read header
3: SWAR decode header info field
4: Read sequence bytes
Besides the original (naive) read method, the main difference between the three is how we read the sequence bytes (and quality scores if this was fastq). Especially how we remove new lines in sequence blocks of fasta.
orig
strip_newline
swar
read_once
Only passes over bytes once
Design of the Experiment
Input: 2.6G uncompressed fasta file
All builds used the same mojo build fastxpp_bench.mojo invocation and were measured with Hyperfine --warmup 3 -r 10 on an otherwise idle machine.
Results Snapshot
Ordering Sensitivity
The last entry in the bench list is most sensitive to @no_inline. In-lining the read bytes functions eliminates most of the difference besides compiling separately.
Summary
var lcnt = (slen + (bpl - 2)) // (bpl - 1)
Next steps