Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] Performance problems with retrieving changesets

On Mon, Mar 28, 2011 at 04:49, Akos Tajti <akos.tajti@xxxxxxxxx> wrote:
> we have sometimes performance problems when retrieving scm changesets. The
> code looks like this:
>   RevWalk walk = new RevWalk(localRepository);
>   AnyObjectId changesetId = localRepository.resolve(ref);
>   if (changesetId != null) {
>   RevCommit commit = walk.parseCommit(changesetId);
>   walk.markStart(commit);
> return createChangeSetFromCommit(walk.next(), fileSet, true, true,
> calculateBranches, null, null);
>  }
> In createChangeSetFromCommit() we get the information we need from the
> commit object. For example: author name, commit date etc. The list of
> changed files is gained in these three lines:
>   ChangedFilesWalker walker = new ChangedFilesWalker(fileSet.getFileList(),
> commit);
>   walker.walk();
>   return walker.getChangedFiles();

What is a ChangedFilesWalker?

> It seems that everything is OK with the code, however sometimes the
> execution takes many seconds (especially for changesets with many changed
> files). Do you have any ideaas how this can be made faster? Is there an
> other/easier way of getting changesets?

It depends on what ChangedFilesWalker is. Finding out the files that
were modified in a commit in Git requires comparing that commit to its
ancestor. That can take some time, but doesn't need to be seconds per
commit.

-- 
Shawn.


Back to the top