52b7f60f3d
The most expensive part of the "IncludedIn" calculation is the processing of paths which do not contain the requested commit. In that case the processor needs to look at all reachable commits starting from the tip commit to the initial commit. The method RevWalk.isMergedIn() walks over the whole parent graph again and again for each tag and each branch. The amount of walks can be reduced by sorting the tags and branches and start bottom up. This allows ignoring subgraphs where the commit is not contained in subsequent iterations and stop graph traversal when a tag or branch is reached where we already know that it contains the commit. Performance measurement on larger Git repositories, like Linux Kernel, indicate that the runtime with the new algorithm is three to four times faster. To be able to expose the "IncludedIn" calculation as a REST service or SSH command I have extracted the algorithm into an own class in the gerrit-server package. Change-Id: I56b32a77e02e47dd31ec6ce4adfe0a781e73a76c Signed-off-by: Christian Grail <christian.grail@sap.com> |
||
---|---|---|
.. | ||
.settings | ||
src | ||
.gitignore | ||
BUCK |