Perl vs. Python for text manipulation
aahz at pythoncraft.com
Sat Jan 24 23:07:04 CET 2004
In article <buubrh$183r$1 at nadya.doma>, Serge Orlov <sombDELETE at pobox.ru> wrote:
>"Aahz" <aahz at pythoncraft.com> wrote in message news:buu7pq$i67$1 at panix1.panix.com...
>> At this point,
>> Perl's speed advantage should come from two and only two sources: Perl
>> optimizes the snot out of platform I/O (so these speed tests don't apply
>> to a platform Perl hasn't been ported to), and Perl does not use the
>> thread-safe forms of I/O. Python does a fair amount of internal caching
>> to make up for that, and the file object is already written in C.
>I'm not sure I understand what does it mean "optimize the snot out
>of platform I/O"? You just use the bare bones non-caching API and do
>your own simple caching doing as little as possible. This will allow
>programs that work with files as streams (read sequentially a lot from
>one file, write sequentially to another) to run at top speed. Other
>access patterns may suffer but not very much.
My understanding is that Perl uses platform-specific low-level I/O calls
when possible. Python sticks with ANSI functions.
Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/
"The joy of coding Python should be in seeing short, concise, readable
classes that express a lot of action in a small amount of clear code --
not in reams of trivial code that bores the reader to death." --GvR
More information about the Python-list