why huge speed difference btwn 1.52 and 2.1?

robin senior rsenior at hotmail.com
Wed Jun 6 10:32:26 EDT 2001


"Neil Schemenauer" <nas at python.ca> wrote in message
news:mailman.991759333.17998.python-list at python.org...
> Your problem is likely that you are re.search() in a loop.  In
> Python 1.5.2 re.search() was a C function.  In 2.1 it is a Python
> function.  Using the pcre.search() function should get your
> program up to speed.  Alternatively, you could revise your
> program.  It is quite inefficient.  This (untested) version
> should be faster:

Thanks, that was exactly what I was wondering about. I fired off the script
in a couple minutes, didn't check it for efficiency (I usually use perl for
regex's, so I'm not used to all these different ways to do them). The script
only had to execute once, and is long done, I was just wondering why the
difference in speed. It was working on a large dataset, and the 1.5.2
machines finished hours before the 2.1 machines.

Cheers,
-robin





More information about the Python-list mailing list