mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[git] more time measurements for the log refresh
This commit is contained in:
@@ -32,6 +32,7 @@ import com.intellij.vcs.log.graph.GraphCommit;
|
||||
import com.intellij.vcs.log.graph.impl.facade.PermanentGraphImpl;
|
||||
import com.intellij.vcs.log.impl.HashImpl;
|
||||
import com.intellij.vcs.log.impl.LogDataImpl;
|
||||
import com.intellij.vcs.log.util.StopWatch;
|
||||
import git4idea.*;
|
||||
import git4idea.branch.GitBranchUtil;
|
||||
import git4idea.config.GitVersionSpecialty;
|
||||
@@ -135,8 +136,10 @@ public class GitLogProvider implements VcsLogProvider {
|
||||
}
|
||||
}
|
||||
|
||||
StopWatch sw = StopWatch.start("sorting commits in " + root.getName());
|
||||
List<VcsCommitMetadata> sortedCommits = VcsLogSorter.sortByDateTopoOrder(allDetails);
|
||||
sortedCommits = sortedCommits.subList(0, Math.min(sortedCommits.size(), requirements.getCommitCount()));
|
||||
sw.report();
|
||||
|
||||
if (LOG.isDebugEnabled()) {
|
||||
validateDataAndReportError(root, allRefs, sortedCommits, data, branches, currentTagNames, commitsFromTags);
|
||||
@@ -152,6 +155,7 @@ public class GitLogProvider implements VcsLogProvider {
|
||||
final Set<VcsRef> manuallyReadBranches,
|
||||
@Nullable final Set<String> currentTagNames,
|
||||
@Nullable final DetailedLogData commitsFromTags) {
|
||||
StopWatch sw = StopWatch.start("validating data in " + root.getName());
|
||||
final Set<Hash> refs = ContainerUtil.map2Set(allRefs, new Function<VcsRef, Hash>() {
|
||||
@Override
|
||||
public Hash fun(VcsRef ref) {
|
||||
@@ -181,6 +185,7 @@ public class GitLogProvider implements VcsLogProvider {
|
||||
return 0;
|
||||
}
|
||||
}, refs);
|
||||
sw.report();
|
||||
}
|
||||
|
||||
@SuppressWarnings("StringConcatenationInsideStringBufferAppend")
|
||||
@@ -264,8 +269,10 @@ public class GitLogProvider implements VcsLogProvider {
|
||||
|
||||
@NotNull
|
||||
private Set<String> readCurrentTagNames(@NotNull VirtualFile root) throws VcsException {
|
||||
StopWatch sw = StopWatch.start("reading tags in " + root.getName());
|
||||
Set<String> tags = newHashSet();
|
||||
GitTag.listAsStrings(myProject, root, tags, null);
|
||||
sw.report();
|
||||
return tags;
|
||||
}
|
||||
|
||||
@@ -289,9 +296,11 @@ public class GitLogProvider implements VcsLogProvider {
|
||||
@NotNull
|
||||
private DetailedLogData loadSomeCommitsOnTaggedBranches(@NotNull VirtualFile root, int commitCount,
|
||||
@NotNull Collection<String> unmatchedTags) throws VcsException {
|
||||
StopWatch sw = StopWatch.start("loading commits on tagged branch in " + root.getName());
|
||||
List<String> params = new ArrayList<String>();
|
||||
params.add("--max-count=" + commitCount);
|
||||
params.addAll(unmatchedTags);
|
||||
sw.report();
|
||||
return GitHistoryUtils.loadMetadata(myProject, root, true, ArrayUtil.toStringArray(params));
|
||||
}
|
||||
|
||||
@@ -337,6 +346,7 @@ public class GitLogProvider implements VcsLogProvider {
|
||||
|
||||
@NotNull
|
||||
private Set<VcsRef> readBranches(@NotNull GitRepository repository) {
|
||||
StopWatch sw = StopWatch.start("readBranches in " + repository.getRoot().getName());
|
||||
VirtualFile root = repository.getRoot();
|
||||
repository.update();
|
||||
Collection<GitLocalBranch> localBranches = repository.getBranches().getLocalBranches();
|
||||
@@ -354,6 +364,7 @@ public class GitLogProvider implements VcsLogProvider {
|
||||
if (currentRevision != null) { // null => fresh repository
|
||||
refs.add(myVcsObjectsFactory.createRef(HashImpl.build(currentRevision), "HEAD", GitRefManager.HEAD, root));
|
||||
}
|
||||
sw.report();
|
||||
return refs;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user