From 6ec33c4986d480e80c53c14ae63d1a09701bc1a9 Mon Sep 17 00:00:00 2001 From: Konstantin Kolosovsky Date: Mon, 21 May 2018 21:50:19 +0300 Subject: [PATCH] vcs: More diagnostics for repository tab performance (IDEA-119539) --- .../changes/committed/ChangesCacheFile.java | 24 +++++++------------ 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/ChangesCacheFile.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/ChangesCacheFile.java index 2cf5287e9ce8..9b660cc385c2 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/ChangesCacheFile.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/ChangesCacheFile.java @@ -1,20 +1,7 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.openapi.vcs.changes.committed; +import com.google.common.base.Stopwatch; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Pair; @@ -45,7 +32,7 @@ import static com.intellij.openapi.vcs.changes.committed.IncomingChangeState.Sta * @author yole */ public class ChangesCacheFile { - private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.vcs.changes.committed.ChangesCacheFile"); + private static final Logger LOG = Logger.getInstance(ChangesCacheFile.class); private static final int VERSION = 7; private final File myPath; @@ -818,7 +805,9 @@ public class ChangesCacheFile { myChangesCacheFile.saveIncoming(data, true); } } else { + Stopwatch stopWatch = Stopwatch.createStarted(); shouldChangeHeader = refreshIncomingInFile(incomingFiles, list); + debug("Finished incoming refresh for " + myChangesCacheFile.myLocation.toPresentableString() + " in " + stopWatch.stop()); } IncomingChangeState.footer(); @@ -842,7 +831,9 @@ public class ChangesCacheFile { myIndexStreamCachedLength = myChangesCacheFile.myIndexStream.length(); // try to process changelists in a light way, remember which files need revisions + Stopwatch stopWatch = Stopwatch.createUnstarted(); for(IncomingChangeListData data: list) { + stopWatch.reset().start(); debug("Checking incoming changelist " + data.changeList.getNumber()); for(Change change: data.getChangesToProcess()) { @@ -854,6 +845,7 @@ public class ChangesCacheFile { revisionDependentFiles.put(key, result.file); } } + debug("Finished checking incoming changelist " + data.changeList.getNumber() + " in " + stopWatch.stop()); } if (!revisionDependentFiles.isEmpty()) {