marcelm / dnaio

Efficiently read and write sequencing data from Python
https://dnaio.readthedocs.io/
MIT License
61 stars 9 forks source link

Using memcmp with a fixed length leads to very efficient assembly #125

Closed rhpvorderman closed 11 months ago

rhpvorderman commented 11 months ago

This is inconsequential except that it leads to slightly cleaner code and slightly cleaner assembly. In this case the compiler will turn it into a direct comparison of two 16 bit integers, rather than comparing the characters individually. Since the branch is very predictable, there is no performance impact.