[MERGE] is_ignored improvements...

Martin Pool mbp at canonical.com
Mon May 22 04:00:18 BST 2006


On 19 May 2006, Robert Collins <robertc at robertcollins.net> wrote:
> I've had some further thoughts on this optimisation...
> 
> I think we might get better performance still if we grouped the basename
> only matches into one regex:
> 
> Rather than translating
> ["foo", "foo/bad", "bar*"] into
> 
> "((?:.*/)?(?!.*/)foo$)|((?:.*/)?(?!.*/)bar.*$)|(foo/bad$)"
> 
> if we translated that as
> "(?:(?:.*/)?(?!.*/)(?:(foo)|(bar.*))|(foo/bad))$"
> 
> it would mean there is only one negative lookahead assertion in the
> entire group. This will require reordering of the ignore rules to
> combine them like this, but I think thats worth it (as a second step
> optimisation).

But you should be able to have no lookahead assertions at all if you
just match * and ? in the right way (that is, saying that they cannot
match /).  I would expect that will be faster.

-- 
Martin




More information about the bazaar mailing list