Bob wrote:

> Ruby: 83.938 seconds
> Python: 18.52 seconds
> 

It seems that String#include is not implemented efficiently
in Ruby (In fact it is a simple loop of memcmps).

As I replace the list of strings by a list of regular
expressions (not by a single one, but a list of 6 keywords), then
I got on my Linux box (70MB logfile):

Python 2.2 (#1, Mar 26 2002, 15:46:04)
ruby 1.7.3 (2002-09-23) [i686-linux]
ruby 1.6.7 (2002-03-01) [i686-linux]

Python took: 28.18 seconds
Ruby 1.7.3 took 19.199376 seconds.
Ruby 1.6.7 took 23.12174 seconds.

the result file is:
wc z
  177948 1398284 14462965 z

I used the same keywords and the output files were identical.
I did not alter the Python program, so it did not use regular
expressions.

Regards, Christian