Re: Inexplicable timings

2008-08-02 Thread MRAB
On Aug 2, 12:43 am, MRAB <[EMAIL PROTECTED]> wrote: > I'm looking at the implementation of regular expressions in Python and > wrote a script to test my changes. This is the script: > > import re > import time > > base = "abc" > final = "d" > > for n in [100, 1000, 1]: >     for f in [final, ""

Inexplicable timings

2008-08-01 Thread MRAB
I'm looking at the implementation of regular expressions in Python and wrote a script to test my changes. This is the script: import re import time base = "abc" final = "d" for n in [100, 1000, 1]: for f in [final, ""]: for r in ["+", "+?"]: pattern = "(?:%s)%s%s" %