[Python-Dev] Re: string find(substring) vs. substring in string

Scott David Daniels Scott.Daniels at Acm.Org
Wed Feb 16 23:19:20 CET 2005


Fredrik Lundh wrote:
> (btw, the benchmark was taken from jim hugunin's ironpython talk, and
> seems to be carefully designed to kill performance also for more advanced
> algorithms -- including boyer-moore)

Looking for "not there" in "not the xyz"*100 using Boyer-Moore should do
about 300 probes once the table is set (the underscores below):
     not the xyznot the xyznot the xyz...
     not ther_
              not the__
                not ther_
                         not the__
                           not ther_
         ...

-- Scott David Daniels
Scott.Daniels at Acm.Org



More information about the Python-Dev mailing list