why huge speed difference btwn 1.52 and 2.1?

Fredrik Lundh fredrik at pythonware.com
Wed Jun 6 13:37:09 EDT 2001


Neil Schemenauer wrote:
> 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.

not really true: re.search is a Python function in both versions,
re.compile().search is a Python method in 1.5.2 and a C method
in 2.1.

the 2.1 engine has a slower compiler, though.

> Using the pcre.search() function should get your program up
> to speed

that's pre.search(), not pcre.search().

</F>





More information about the Python-list mailing list