Yet another Python vs. Perl speed issue/question

Paul Prescod paulp at ActiveState.com
Wed Mar 14 00:27:13 CET 2001


nanotech at europa.com wrote:
> 
> All:
> 
> Python 2.0 on an HP (nice and big) takes ~30 seconds to lowercase all
> the lines in a 3meg file. Perl takes less than a second. What am I
> doing wrong?!?
> 
> Python
> ------
> import sys
> import string
> 
> stdin=sys.stdin
> lower=string.lower
> 
> print map(lower,stdin.readlines())

My lowly laptop runs this in around a second on 3MB. Something must be
misconfigured on your server. What's Python's startup time like? Just
type "python"? Does it come up quickly?

-- 
Python:
    Programming the way
    Guido
    indented it.
       - (originated with Skip Montanaro?)




More information about the Python-list mailing list