pygrep

Steven_Shaw at adc.com Steven_Shaw at adc.com
Wed May 2 05:50:47 EDT 2001



Hi there,

I have converted an old Perl4 script to Python2.1. It is a simple tool to
replace grep. My new Python script currently runs about twice as slow as the old
Perl version. I've tried afew things from the Python FAQ, but nothing seems to
improve things much. Can anyone suggest performance improvements for this code?

Here's the original Perl source code (pgrep):

(See attached file: pgrep)

Here's the Python source code (pygrep):

(See attached file: pygrep)

cheers,

Steve.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pgrep
Type: application/octet-stream
Size: 125 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20010502/77ad02b3/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pygrep
Type: application/octet-stream
Size: 667 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20010502/77ad02b3/attachment-0001.obj>


More information about the Python-list mailing list