Python slow for filter scripts
Cameron Laird
claird at lairds.com
Tue Oct 28 18:00:37 EST 2003
In article <riCnb.36947$mZ5.185175 at attbi_s54>,
David C. Fox <davidcfox at post.harvard.edu> wrote:
>Peter Mutsaers wrote:
.
.
.
>> I found that on my (linux) PC, the Python version was 4 times slower.
>>
>> Is that normal, does it disqualify Python for simple filter scripts?
>
>You don't show the Python script you use, so there's no way for us to
>tell whether it is possible to do it more efficiently.
>
>Also, what size file did you use? Unless you tried it with a large
>enough file, so that the time was proportional to the file size, you may
>just have measured the difference in the startup time for perl vs. python.
>
>Finally, the relative performance of two languages on Task X is not a
>very good predictor of their relative performance on Task Y, so you are
>probably better off doing a comparison of the actual task you are
>interested in.
>
>David
>
... and, no, of course it doesn't disqualify Python from
essentially all of the jobs where I want to use it. If,
in an extreme case, a Python solution takes eight seconds,
while the corresponding Perl requires two--well, for most
jobs solved by "simple filter scripts", I can live with
that.
--
Cameron Laird <claird at phaseit.net>
Business: http://www.Phaseit.net
More information about the Python-list
mailing list