Python IO performance?

Aahz aahz at pythoncraft.com
Sat May 31 10:10:12 EDT 2003


In article <m33civ37b2.fsf at localhost.localdomain>,
Ganesan R  <rganesan at myrealbox.com> wrote:
>
>I apologize for bringing up this topic again. I am sure I am missing
>something obvious. I am a relatively recent perl to python convert
>and I always had a nagging feeling that processing text files with
>python was slow. 

Although there has been some speedup in Python for this, Perl's current
design wins over Python for two reasons (please let me know if my info
is out of date):

* Perl does not use thread-safe file I/O.  Even running in single-thread
mode, making calls into the thread-safe OS subsystem slows things down.

* Perl uses OS-specific FILE* hacks for speed; Python mostly sticks with
simple, portable calls.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"In many ways, it's a dull language, borrowing solid old concepts from
many other languages & styles:  boring syntax, unsurprising semantics,
few automatic coercions, etc etc.  But that's one of the things I like
about it."  --Tim Peters on Python, 16 Sep 93




More information about the Python-list mailing list