[MERGE] is_ignored improvements...

Jan Hudec bulb at ucw.cz
Fri May 19 06:45:05 BST 2006


On Fri, May 19, 2006 at 15:40:16 +1000, Robert Collins 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).

Yes, that sounds reasonable. Actually the reordering wouldn't be hard.
When the pattern is converted, there is an if with 3 branches. So the
function could contain the loop as well and put the pattern into one of
three lists, depending on the branch. Then combine each list and prefix
as a whole.

-- 
						 Jan 'Bulb' Hudec <bulb at ucw.cz>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060519/52c6ce43/attachment.pgp 


More information about the bazaar mailing list