quick question

Cousin Stanley CousinStanley at HotMail.com
Wed Nov 20 10:54:54 EST 2002


John ...

Your counter class seems to work the best on my machine
of all the versions we've been through thus far
running about almost 30% faster than the original
normal loop version ...

Using the ~260,000 record [ 2.6 MB ] IceCream.txt file as input ...

    8.84 Seconds ... Original Normal Loop
    5.39 Seconds ... Original Normal Loop Psyco
    8.29 Seconds ... JH Map Psyco

    6.31 Seconds ... class counter
    4.01 Seconds ... class counter Psyco

   32.46 Seconds ... class counter letter freq
   11.20 Seconds ... class counter letter freq Psyco

These results are under Win98 First Edition
using a 250 MHz processor ...

The counter class code is nice and simple
and I think that applying the  read()  method
to the file to automagically end up with
input byte value frequencies is pretty slick ...

I haven't checked the Python CookBook yet
to see if anything similar to your counter class
is available there or not, but if it isn't, it should be ...

I think it's also worthwhile to emphasize
the Psyco binding improvements in all cases here,
especially as shown in the last 2 tests in the list above
where the Psyco version improvement is dramatic
and that is achieved with a single line of code ...

Thanks again for your help and feedback ...

Cousin Stanley





More information about the Python-list mailing list