deprecate legacy scaling in performance tests

This commit is contained in:
Dmitry Batrak
2015-11-30 11:58:49 +03:00
parent 65d61599f8
commit b1f6d9b57f
43 changed files with 186 additions and 95 deletions
@@ -1,3 +1,18 @@
/*
* Copyright 2000-2015 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.
*/
package com.intellij.codeInsight.completion;
import com.intellij.JavaTestUtil;
@@ -92,7 +107,7 @@ public class SecondSmartTypeCompletionTest extends LightFixtureCompletionTestCas
assertNotNull(myItems);
LookupManager.getInstance(getProject()).hideActiveLookup();
}
}).cpuBound().assertTiming();
}).cpuBound().useLegacyScaling().assertTiming();
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
* Copyright 2000-2015 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.
@@ -110,7 +110,7 @@ public class LightAdvHighlightingPerformanceTest extends LightDaemonAnalyzerTest
List<HighlightInfo> h = doHighlighting();
infos.addAll(h);
}
}).cpuBound().usesAllCPUCores().assertTiming();
}).cpuBound().usesAllCPUCores().useLegacyScaling().assertTiming();
return highlightErrors();
}
@@ -1,3 +1,18 @@
/*
* Copyright 2000-2015 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.
*/
package com.intellij.codeInsight.daemon;
import com.intellij.psi.*;
@@ -34,7 +49,7 @@ public class RecursiveVisitorTest extends LightDaemonAnalyzerTestCase{
});
assertEquals(N+2, n[0]);
}
}).cpuBound().assertTiming();
}).cpuBound().useLegacyScaling().assertTiming();
}
public void testHugeMethodChainingVisitingPerformance() throws IncorrectOperationException {
StringBuilder text = new StringBuilder("Object s = new StringBuilder()");
@@ -59,6 +74,6 @@ public class RecursiveVisitorTest extends LightDaemonAnalyzerTestCase{
});
assertEquals(N, n[0]);
}
}).cpuBound().assertTiming();
}).cpuBound().useLegacyScaling().assertTiming();
}
}
@@ -1084,7 +1084,7 @@ public class DaemonRespondToChangesTest extends DaemonAnalyzerTestCase {
backspace();
infos = highlightErrors();
assertEmpty(infos);
}).assertTiming();
}).useLegacyScaling().assertTiming();
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
* Copyright 2000-2015 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.
@@ -103,7 +103,7 @@ public class OverloadResolutionTest extends LightDaemonAnalyzerTestCase {
public void run() throws Throwable {
doTest(false);
}
}).assertTiming();
}).useLegacyScaling().assertTiming();
}
public void testConstructorOverloadsWithDiamonds() throws Exception {
@@ -112,7 +112,7 @@ public class OverloadResolutionTest extends LightDaemonAnalyzerTestCase {
public void run() throws Throwable {
doTest(false);
}
}).assertTiming();
}).useLegacyScaling().assertTiming();
}
public void testMultipleOverloadsWithNestedGeneric() throws Exception {
@@ -590,10 +590,10 @@ public class FindManagerTest extends DaemonAnalyzerTestCase {
ThrowableRunnable test = () -> assertSize(lineCount, findUsages(findModel));
findModel.setCustomScope(GlobalSearchScope.fileScope(psiFile));
PlatformTestUtil.startPerformanceTest("slow", 400, test).attempts(2).cpuBound().usesAllCPUCores().assertTiming();
PlatformTestUtil.startPerformanceTest("slow", 400, test).attempts(2).cpuBound().usesAllCPUCores().useLegacyScaling().assertTiming();
findModel.setCustomScope(new LocalSearchScope(psiFile));
PlatformTestUtil.startPerformanceTest("slow", 400, test).attempts(2).cpuBound().usesAllCPUCores().assertTiming();
PlatformTestUtil.startPerformanceTest("slow", 400, test).attempts(2).cpuBound().usesAllCPUCores().useLegacyScaling().assertTiming();
}
finally {
fixture.tearDown();
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* Copyright 2000-2015 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.
@@ -17,8 +17,6 @@
package com.intellij.navigation;
import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer;
import com.intellij.codeInsight.daemon.impl.HighlightInfo;
import com.intellij.codeInsight.navigation.GotoImplementationHandler;
import com.intellij.psi.PsiClass;
import com.intellij.psi.PsiElement;
@@ -28,8 +26,6 @@ import com.intellij.testFramework.PlatformTestUtil;
import com.intellij.testFramework.fixtures.JavaCodeInsightFixtureTestCase;
import com.intellij.util.ThrowableRunnable;
import java.util.List;
public class GotoImplementationHandlerTest extends JavaCodeInsightFixtureTestCase {
public void testMultipleImplsFromAbstractCall() throws Throwable {
@@ -81,7 +77,7 @@ public class GotoImplementationHandlerTest extends JavaCodeInsightFixtureTestCas
final PsiElement[] impls = new GotoImplementationHandler().getSourceAndTargetElements(myFixture.getEditor(), file).targets;
assertEquals(3, impls.length);
}
}).cpuBound().usesAllCPUCores().assertTiming();
}).cpuBound().usesAllCPUCores().useLegacyScaling().assertTiming();
}
public void testToStringOnQualified() throws Throwable {
@@ -111,7 +107,7 @@ public class GotoImplementationHandlerTest extends JavaCodeInsightFixtureTestCas
final PsiElement[] impls = new GotoImplementationHandler().getSourceAndTargetElements(myFixture.getEditor(), file).targets;
assertEquals(3, impls.length);
}
}).cpuBound().usesAllCPUCores().assertTiming();
}).cpuBound().usesAllCPUCores().useLegacyScaling().assertTiming();
}
@@ -516,7 +516,7 @@ public class JavaStubBuilderTest extends LightIdeaTestCase {
String text = FileUtil.loadFile(new File(path));
PsiJavaFile file = (PsiJavaFile)createLightFile("test.java", text);
String message = "Source file size: " + text.length();
PlatformTestUtil.startPerformanceTest(message, 2000, () -> myBuilder.buildStubTree(file)).cpuBound().assertTiming();
PlatformTestUtil.startPerformanceTest(message, 2000, () -> myBuilder.buildStubTree(file)).cpuBound().useLegacyScaling().assertTiming();
}
private void doTest(String source, String expected) {
@@ -64,7 +64,7 @@ public class JavaAutoDetectIndentPerformanceTest extends AbstractIndentAutoDetec
PlatformTestUtil
.startPerformanceTest("Detecting indent on hot file", 40, AbstractIndentAutoDetectionTest::detectIndentOptions)
.cpuBound()
.assertTiming();
.useLegacyScaling().assertTiming();
}
private static long trackTime(Runnable runnable) {
@@ -72,7 +72,7 @@ public class JavaFormatterPerformanceTest extends JavaFormatterTestCase {
((FormatterImpl)FormatterEx.getInstanceEx()).formatWithoutModifications(model.getDocumentModel(), model.getRootBlock(), settings,
settings.getIndentOptions(StdFileTypes.JAVA),
file.getTextRange());
}).cpuBound().assertTiming();
}).cpuBound().useLegacyScaling().assertTiming();
}
public void testPerformance2() throws Exception {
@@ -85,7 +85,7 @@ public class JavaFormatterPerformanceTest extends JavaFormatterTestCase {
catch (Exception e) {
throw new RuntimeException(e);
}
}).cpuBound().assertTiming();
}).cpuBound().useLegacyScaling().assertTiming();
}
public void testPerformance3() throws Exception {
@@ -105,7 +105,7 @@ public class JavaFormatterPerformanceTest extends JavaFormatterTestCase {
catch (Exception e) {
throw new RuntimeException(e);
}
}).cpuBound().assertTiming();
}).cpuBound().useLegacyScaling().assertTiming();
}
private static void transformAllChildren(final ASTNode file) {
@@ -50,7 +50,7 @@ public class JavaSmartReformatPerformanceTest extends AbstractJavaFormatterTest
.startPerformanceTest("Testing smart reformat on big file", 110, getReformatRunnable(file, ranges))
.setup(getSetupRunnable(initial, document))
.cpuBound()
.assertTiming();
.useLegacyScaling().assertTiming();
}
@@ -683,7 +683,7 @@ public class SmartPsiElementPointersTest extends CodeInsightTestCase {
assertFalse(PsiDocumentManager.getInstance(myProject).isCommitted(document));
assertEquals(range, pointer.getRange());
}
}).cpuBound().assertTiming();
}).cpuBound().useLegacyScaling().assertTiming();
PsiDocumentManager.getInstance(myProject).commitAllDocuments();
assertEquals(range, pointer.getRange());
@@ -867,7 +867,7 @@ public class SmartPsiElementPointersTest extends CodeInsightTestCase {
assertEquals(tag.getName().length(), TextRange.create(pointer.getPsiRange()).getLength());
}
PostprocessReformattingAspect.getInstance(myProject).doPostponedFormatting();
}).cpuBound().assertTiming();
}).cpuBound().useLegacyScaling().assertTiming();
}
@NotNull