[JGIT PATCH 0/m] Implementation of a file tree iteration using ignore rules.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

here are the patches.

The implementation does a lot of performance optimizations:

1.) Instead of checking all the rules from top to bottom, I simply take the first matching rule beginning from bottom. I actually have intern a list with a inversed order and take then the first matching rule.


2.) Each sub directory has it's own optimized rules.

2.1.) Rules which can never match are removed. e.g. There is no need to check the rule "/a" in the directory b.

2.2.) The list is cut at the first rule which match always. *.txt\n/a for example would result in an internal list "ignore all, ignore *.txt" which is then reduced to "ignore all".

2.3.) Ignore rules which are direcly before an "ignore all" all rule are removed. /a\n*.txt for example would result in an intern "ignore *.txt, ignore all" list which is then reduced to "ignore all",

2.4.) "do not ignore" rules at the bottom of the intern list are removed. This optimization would remove !a from "!a\n/b" as it is in the inversed list at the bottom.

2.5.) When converting the rule list into an instance of the Rules interface, rule lists with only one always matching rule are converted to Rules.IGNORE_NOTHING and Rules.IGNORE_ALL objects. These special objects avoid unessary object construction as they reuse themself for sub directories.


3.) Only rules are evaluated which could match at the current directory level. e.g. You don't need to check the rule /a/b/c for every file in /a, but only for files in the directory /a/b


4.) The Iterator doesn't walk into trees from which it knows that they will never match. It can do so by comparing the rules instance for the directory with the value of Rules.IGNORE_ALL.

Best regards,
Florian Koeberle
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux