use of com.intellij.vcs.log.util.StopWatch in project intellij-community by JetBrains.
the class VcsLogRefresherImpl method compactCommits.
@NotNull
private List<GraphCommit<Integer>> compactCommits(@NotNull List<? extends TimedVcsCommit> commits, @NotNull final VirtualFile root) {
StopWatch sw = StopWatch.start("compacting commits");
List<GraphCommit<Integer>> map = ContainerUtil.map(commits, new Function<TimedVcsCommit, GraphCommit<Integer>>() {
@NotNull
@Override
public GraphCommit<Integer> fun(@NotNull TimedVcsCommit commit) {
return compactCommit(commit, root);
}
});
myStorage.flush();
sw.report();
return map;
}
use of com.intellij.vcs.log.util.StopWatch in project intellij-community by JetBrains.
the class GitHistoryUtils method loadDetails.
public static void loadDetails(@NotNull Project project, @NotNull VirtualFile root, boolean withRefs, boolean withChanges, @NotNull Consumer<GitLogRecord> converter, String... parameters) throws VcsException {
List<String> configParameters = Registry.is("git.diff.renameLimit.infinity") && withChanges ? Collections.singletonList("diff.renameLimit=0") : Collections.emptyList();
GitLineHandler h = new GitLineHandler(project, root, GitCommand.LOG, configParameters);
GitLogParser parser = createParserForDetails(h, project, withRefs, withChanges, parameters);
StopWatch sw = StopWatch.start("loading details");
processHandlerOutputByLine(h, parser, converter);
sw.report();
}
use of com.intellij.vcs.log.util.StopWatch in project intellij-community by JetBrains.
the class GitLogProvider method loadSomeCommitsOnTaggedBranches.
@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<>();
params.add("--max-count=" + commitCount);
params.addAll(unmatchedTags);
sw.report();
return GitHistoryUtils.loadMetadata(myProject, root, ArrayUtil.toStringArray(params));
}
use of com.intellij.vcs.log.util.StopWatch in project intellij-community by JetBrains.
the class GitLogProvider method validateDataAndReportError.
private static void validateDataAndReportError(@NotNull final VirtualFile root, @NotNull final Set<VcsRef> allRefs, @NotNull final List<VcsCommitMetadata> sortedCommits, @NotNull final DetailedLogData firstBlockSyncData, @NotNull 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, VcsRef::getCommitHash);
PermanentGraphImpl.newInstance(sortedCommits, new GraphColorManager<Hash>() {
@Override
public int getColorOfBranch(@NotNull Hash headCommit) {
return 0;
}
@Override
public int getColorOfFragment(@NotNull Hash headCommit, int magicIndex) {
return 0;
}
@Override
public int compareHeads(@NotNull Hash head1, @NotNull Hash head2) {
if (!refs.contains(head1) || !refs.contains(head2)) {
LOG.error("GitLogProvider returned inconsistent data", new Attachment("error-details.txt", printErrorDetails(root, allRefs, sortedCommits, firstBlockSyncData, manuallyReadBranches, currentTagNames, commitsFromTags)));
}
return 0;
}
}, refs);
sw.report();
}
use of com.intellij.vcs.log.util.StopWatch in project intellij-community by JetBrains.
the class DataPack method build.
@NotNull
public static DataPack build(@NotNull List<? extends GraphCommit<Integer>> commits, @NotNull Map<VirtualFile, CompressedRefs> refs, @NotNull Map<VirtualFile, VcsLogProvider> providers, @NotNull VcsLogStorage storage, boolean full) {
RefsModel refsModel;
PermanentGraph<Integer> permanentGraph;
if (commits.isEmpty()) {
refsModel = new RefsModel(refs, ContainerUtil.newHashSet(), storage, providers);
permanentGraph = EmptyPermanentGraph.getInstance();
} else {
refsModel = new RefsModel(refs, getHeads(commits), storage, providers);
Function<Integer, Hash> hashGetter = VcsLogStorageImpl.createHashGetter(storage);
GraphColorManagerImpl colorManager = new GraphColorManagerImpl(refsModel, hashGetter, getRefManagerMap(providers));
Set<Integer> branches = getBranchCommitHashIndexes(refsModel.getBranches(), storage);
StopWatch sw = StopWatch.start("building graph");
permanentGraph = PermanentGraphImpl.newInstance(commits, colorManager, branches);
sw.report();
}
return new DataPack(refsModel, permanentGraph, providers, full);
}
Aggregations