Skip to content

Instantly share code, notes, and snippets.

View gerdus's full-sized avatar

Gerdus van Zyl gerdus

View GitHub Profile
@gerdus
gerdus / gist:5553616
Last active December 17, 2015 04:49
PyPy optimized version for http://saml.rilspace.org/gc-content-continued-python-vs-d-vs-c-vs-free-pascal optimizations: reading file in binary mode and readlines with size hint
import timeit
tfunc = timeit.default_timer
def main():
file = open("Homo_sapiens.GRCh37.61.dna_rm.chromosome.Y.fa","rb")
gcCount = 0
totalBaseCount = 0
while 1:
lines = file.readlines(10000)
if not lines: