Kris Kennaway wrote:
<cut>
If you can't use an indexer, and performance matters, evaluate using
grep and a shell script. Seriously.
grep is a couple of orders of magnitude faster at pattern matching
strings in files (and especially regexps) than python is. Even if you
are invoking grep multiple times it is still likely to be faster than a
"maximally efficient" single pass over the file in python. This
realization was disappointing to me :)
Kris
Adding to this:
Then again, there is nothing wrong with wrapping grep from python and
revert to a pure python 'solution' if the system has no grep.
Reinventing the wheel is usually only practical if the existing ones
aren't round :-)
--
mph
--
http://mail.python.org/mailman/listinfo/python-list