[pypy-dev] pypy1.6 slow on string-heavy ops
Jacob Biesinger
jake.biesinger at gmail.com
Thu Aug 18 23:48:51 CEST 2011
A better breakdown...
fasta_file = sys.argv[1] # should be *.fa
> print 'loading dna from', fasta_file
> chroms = {}
> dna = None
> for l in open(fasta_file):
> if l.startswith('>'): # new chromosome
> if dna is not None:
> chroms[chrom] = dna
> chrom = l.strip().replace('>', '')
> dna = ''
> else:
> dna += l.rstrip()
> if dna is not None:
> chroms[chrom] = dna
>
CPython takes about 1.5 seconds to get to this point in the code, while pypy
hasn't passed this point in 30 minutes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20110818/51de3347/attachment.html>
More information about the pypy-dev
mailing list