How to make regexes faster? (Python v. OmniMark)
Cameron Laird
claird at starbase.neosoft.com
Fri Apr 19 14:03:10 EDT 2002
In article <a9pj29$pdm$1 at nntp6.u.washington.edu>,
Donn Cave <donn at u.washington.edu> wrote:
.
.
.
>Part of the problem is that when you write something like a "grep"
>in Python and in Perl, the Perl program will naturally be written
>like while ($line = <STDIN>) {...}, and the Python program will
>naturally be written like while 1: line = sys.stdin.readline() ...
>That pits a lot of function calls against what must be an inline
>operation. I think I decided that "I/O", in this practical sense
.
.
.
Worse (or at least "more"): Perl goes out of its way to optimize
while ($line = <>) {...}
'Least, it has in the past; I haven't looked lately.
--
Cameron Laird <Cameron at Lairds.com>
Business: http://www.Phaseit.net
Personal: http://starbase.neosoft.com/~claird/home.html
More information about the Python-list
mailing list