diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/JavaCommentByLineTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/JavaCommentByLineTest.java index b40f136ce19b..716ffeb7f215 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/JavaCommentByLineTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInsight/JavaCommentByLineTest.java @@ -131,7 +131,7 @@ public class JavaCommentByLineTest extends CommentByLineTestBase { source.append("}"); configureFromFileText(getTestName(false) + ".java", source.toString()); executeAction(IdeActions.ACTION_SELECT_ALL); - PlatformTestUtil.startPerformanceTest("Uncommenting large file", 2000, CommentByLineTestBase::performAction) + PlatformTestUtil.startPerformanceTest("Uncommenting large file", CommentByLineTestBase::performAction) .setup(CommentByLineTestBase::performAction) .assertTiming(); } diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/impl/DaemonRespondToChangesPerformanceTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/impl/DaemonRespondToChangesPerformanceTest.java index c82154935e61..0412a7db37e3 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/impl/DaemonRespondToChangesPerformanceTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/impl/DaemonRespondToChangesPerformanceTest.java @@ -54,13 +54,13 @@ public class DaemonRespondToChangesPerformanceTest extends DaemonAnalyzerTestCas text.append(".toString();}"); configureByText(JavaFileType.INSTANCE, text.toString()); - PlatformTestUtil.startPerformanceTest(getName(), 100_000, () -> { + PlatformTestUtil.startPerformanceTest(getName(), () -> { List infos = highlightErrors(); assertEmpty(infos); type("k"); assertNotEmpty(highlightErrors()); backspace(); - }).usesAllCPUCores().assertTiming(); + }).assertTiming(); } public void testExpressionListsWithManyStringLiteralsHighlightingPerformance() { @@ -75,14 +75,14 @@ public class DaemonRespondToChangesPerformanceTest extends DaemonAnalyzerTestCas PlatformTestUtil.maskExtensions(MultiHostInjector.MULTIHOST_INJECTOR_EP_NAME, getProject(), Collections.emptyList(), getTestRootDisposable()); ExtensionTestUtil.maskExtensions(LanguageInjector.EXTENSION_POINT_NAME, Collections.emptyList(), getTestRootDisposable()); ExtensionTestUtil.maskExtensions(new ExtensionPointName<>(LanguageAnnotators.INSTANCE.getName()), Collections.emptyList(), getTestRootDisposable()); - PlatformTestUtil.startPerformanceTest("highlighting many string literals", 11_000, () -> { + PlatformTestUtil.startPerformanceTest("highlighting many string literals", () -> { assertEmpty(highlightErrors()); type("k"); assertNotEmpty(highlightErrors()); backspace(); - }).usesAllCPUCores().assertTiming(); + }).assertTiming(); } public void testPerformanceOfHighlightingLongCallChainWithHierarchyAndGenerics() { @@ -97,14 +97,14 @@ public class DaemonRespondToChangesPerformanceTest extends DaemonAnalyzerTestCas ".toString(); } }"; configureByText(JavaFileType.INSTANCE, text); - PlatformTestUtil.startPerformanceTest("highlighting deep call chain", 50_000, () -> { + PlatformTestUtil.startPerformanceTest("highlighting deep call chain", () -> { assertEmpty(highlightErrors()); type("k"); assertNotEmpty(highlightErrors()); backspace(); - }).usesAllCPUCores().assertTiming(); + }).assertTiming(); } public void testReactivityPerformance() throws Throwable { diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/impl/quickfix/CreateMethodFromUsagePerformanceTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/impl/quickfix/CreateMethodFromUsagePerformanceTest.java index b7e1f7e00b7b..411571c026b6 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/impl/quickfix/CreateMethodFromUsagePerformanceTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/impl/quickfix/CreateMethodFromUsagePerformanceTest.java @@ -10,7 +10,7 @@ import com.intellij.testFramework.SkipSlowTestLocally; public class CreateMethodFromUsagePerformanceTest extends LightQuickFixTestCase { public void testWithHugeNumberOfParameters() { - PlatformTestUtil.startPerformanceTest("5000 args for a new method", 400_000, () -> { + PlatformTestUtil.startPerformanceTest("5000 args for a new method", () -> { String text = "class Foo {{ foo(" + StringUtil.repeat("\"a\", ", 5000) + " \"a\");}}"; configureFromFileText("Foo.java", text); doAction("Create method 'foo' in 'Foo'"); diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/JoinLinesPerformanceTest.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/JoinLinesPerformanceTest.java index 822b7161e158..769c7f2e08c1 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/JoinLinesPerformanceTest.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/JoinLinesPerformanceTest.java @@ -27,8 +27,7 @@ public class JoinLinesPerformanceTest extends LightJavaCodeInsightTestCase { }"""; String inputText = text.replace("$bytes$", bytesOriginal); - PlatformTestUtil.startPerformanceTest(getTestName(false), 2500, - () -> executeAction(IdeActions.ACTION_EDITOR_JOIN_LINES)) + PlatformTestUtil.startPerformanceTest(getTestName(false), () -> executeAction(IdeActions.ACTION_EDITOR_JOIN_LINES)) .setup(() -> configureFromFileText("X.java", inputText)) .assertTiming(); String outputText = text.replace("$bytes$", bytesResult); diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/NormalCompletionTest.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/NormalCompletionTest.java index d8e8e12a8635..31bd386efbcb 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/NormalCompletionTest.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/NormalCompletionTest.java @@ -2316,7 +2316,7 @@ public class NormalCompletionTest extends NormalCompletionTestCase { "localVx }" + "}"; myFixture.configureByText("a.java", text); - PlatformTestUtil.startPerformanceTest(getName(), 300, () -> { + PlatformTestUtil.startPerformanceTest(getName(), () -> { assertEquals(1, myFixture.completeBasic().length); }).setup(() -> { LookupImpl lookup = getLookup(); @@ -2336,7 +2336,7 @@ public class NormalCompletionTest extends NormalCompletionTestCase { "}"; myFixture.addClass(constantClass); myFixture.configureByText("a.java", "import static Constants.*; class C { { fieldx } }"); - PlatformTestUtil.startPerformanceTest(getName(), 10_000, () -> { + PlatformTestUtil.startPerformanceTest(getName(), () -> { int length = myFixture.completeBasic().length; assertTrue(String.valueOf(length), length > 100); }).setup(() -> { diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/SecondSmartTypeCompletionTest.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/SecondSmartTypeCompletionTest.java index 3c010cbfed16..b69a5f2bd3c1 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/SecondSmartTypeCompletionTest.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/SecondSmartTypeCompletionTest.java @@ -114,14 +114,14 @@ public class SecondSmartTypeCompletionTest extends LightFixtureCompletionTestCas public void testChainingPerformance() throws Throwable { myFixture.configureByFile(getTestName(false) + ".java"); - PlatformTestUtil.startPerformanceTest(getTestName(false), 1000, new ThrowableRunnable() { + PlatformTestUtil.startPerformanceTest(getTestName(false), new ThrowableRunnable() { @Override public void run() throws Exception { configure(); assertNotNull(myItems); LookupManager.getInstance(getProject()).hideActiveLookup(); } - }).useLegacyScaling().assertTiming(); + }).assertTiming(); } diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/LightAdvHighlightingPerformanceTest.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/LightAdvHighlightingPerformanceTest.java index fe6afbb71d78..28f66a8c00e8 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/LightAdvHighlightingPerformanceTest.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/LightAdvHighlightingPerformanceTest.java @@ -62,14 +62,14 @@ public class LightAdvHighlightingPerformanceTest extends LightDaemonAnalyzerTest return LightAdvHighlightingTest.BASE_PATH + "/" + getTestName(true) + suffix + ".java"; } - private void startTest(int maxMillis) { + private void startTest() { PsiDocumentManager.getInstance(getProject()).commitAllDocuments(); assertNotNull(getFile().getText()); //to load text CodeInsightTestFixtureImpl.ensureIndexesUpToDate(getProject()); - PlatformTestUtil.startPerformanceTest(getTestName(false), maxMillis, this::doHighlighting) + PlatformTestUtil.startPerformanceTest(getTestName(false), this::doHighlighting) .setup(() -> PsiManager.getInstance(getProject()).dropPsiCaches()) - .usesAllCPUCores().assertTiming(); + .assertTiming(); } public void testAThinlet() { @@ -79,7 +79,7 @@ public class LightAdvHighlightingPerformanceTest extends LightDaemonAnalyzerTest doTest(getFilePath("_hl"), false, false); fail("Actual: " + errors.size()); } - startTest(8_000); + startTest(); } public void testAClassLoader() { @@ -89,7 +89,7 @@ public class LightAdvHighlightingPerformanceTest extends LightDaemonAnalyzerTest doTest(getFilePath("_hl"), false, false); fail("Actual: " + errors.size()); } - startTest(800); + startTest(); } public void testDuplicateMethods() { @@ -104,7 +104,7 @@ public class LightAdvHighlightingPerformanceTest extends LightDaemonAnalyzerTest text.append("}"); configureFromFileText("x.java", text.toString()); assertEmpty(highlightErrors()); - startTest(3_300); + startTest(); } public void testGetProjectPerformance() { @@ -120,7 +120,7 @@ public class LightAdvHighlightingPerformanceTest extends LightDaemonAnalyzerTest assertNotNull(ProjectCoreUtil.theOnlyOpenProject()); getFile().accept(new PsiRecursiveElementVisitor() {}); Project myProject = getProject(); - PlatformTestUtil.startPerformanceTest("getProject() for nested elements", 5000, () -> { + PlatformTestUtil.startPerformanceTest("getProject() for nested elements", () -> { for (int k=0; k<5; k++) { getFile().accept(new PsiRecursiveElementVisitor() { int c; diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/RecursiveVisitorTest.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/RecursiveVisitorTest.java index edd0351c8f82..2ca84f070834 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/RecursiveVisitorTest.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/RecursiveVisitorTest.java @@ -21,7 +21,7 @@ public class RecursiveVisitorTest extends LightDaemonAnalyzerTestCase { final PsiElement expression = JavaPsiFacade.getElementFactory(getProject()).createStatementFromText(text.toString(), null); final int[] n = {0}; - PlatformTestUtil.startPerformanceTest(getTestName(false), 100, new ThrowableRunnable() { + PlatformTestUtil.startPerformanceTest(getTestName(false), new ThrowableRunnable() { @Override public void run() { n[0] = 0; @@ -36,7 +36,7 @@ public class RecursiveVisitorTest extends LightDaemonAnalyzerTestCase { }); assertEquals(N+2, n[0]); } - }).useLegacyScaling().assertTiming(); + }).assertTiming(); } public void testHugeMethodChainingVisitingPerformance() throws IncorrectOperationException { StringBuilder text = new StringBuilder("Object s = new StringBuilder()"); @@ -48,7 +48,7 @@ public class RecursiveVisitorTest extends LightDaemonAnalyzerTestCase { final PsiElement expression = JavaPsiFacade.getElementFactory(getProject()).createStatementFromText(text.toString(), null); final int[] n = {0}; - PlatformTestUtil.startPerformanceTest(getTestName(false), 200, new ThrowableRunnable() { + PlatformTestUtil.startPerformanceTest(getTestName(false), new ThrowableRunnable() { @Override public void run() { n[0] = 0; @@ -61,7 +61,7 @@ public class RecursiveVisitorTest extends LightDaemonAnalyzerTestCase { }); assertEquals(N, n[0]); } - }).useLegacyScaling().assertTiming(); + }).assertTiming(); } public void testStopWalking() { diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/indentGuide/JavaTextBlockIndentGuidePerformanceTest.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/indentGuide/JavaTextBlockIndentGuidePerformanceTest.java index 10b2512c2cd7..9570d09233eb 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/indentGuide/JavaTextBlockIndentGuidePerformanceTest.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/indentGuide/JavaTextBlockIndentGuidePerformanceTest.java @@ -24,9 +24,8 @@ public class JavaTextBlockIndentGuidePerformanceTest extends LightDaemonAnalyzer String text = "class X {\n" + createCodeBlocks(n, nLines) + "\n}"; - PlatformTestUtil.startPerformanceTest(getTestName(false), 7500, this::doHighlighting) + PlatformTestUtil.startPerformanceTest(getTestName(false), this::doHighlighting) .setup(() -> configureFromFileText("X.java", text)) - .usesAllCPUCores() .assertTiming(); } diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/lambda/InferencePerformanceTest.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/lambda/InferencePerformanceTest.java index 067e90799923..a573ad9bbcfa 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/lambda/InferencePerformanceTest.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/lambda/InferencePerformanceTest.java @@ -32,19 +32,19 @@ public class InferencePerformanceTest extends LightDaemonAnalyzerTestCase { @NonNls static final String BASE_PATH = "/codeInsight/daemonCodeAnalyzer/lambda/performance"; public void testPolyMethodCallArgumentPassedToVarargs() { - PlatformTestUtil.startPerformanceTest("50 poly method calls passed to Arrays.asList", 4000, this::doTest).usesAllCPUCores().assertTiming(); + PlatformTestUtil.startPerformanceTest("50 poly method calls passed to Arrays.asList", this::doTest).assertTiming(); } public void testDiamondConstructorCallPassedToVarargs() { - PlatformTestUtil.startPerformanceTest("50 diamond constructor calls passed to Arrays.asList", 12000, this::doTest).usesAllCPUCores().assertTiming(); + PlatformTestUtil.startPerformanceTest("50 diamond constructor calls passed to Arrays.asList", this::doTest).assertTiming(); } public void testDiamondConstructorCallPassedToEnumConstantWithVarargs() { - PlatformTestUtil.startPerformanceTest("10 enum constants with vararg diamonds", 12000, this::doTest).usesAllCPUCores().assertTiming(); + PlatformTestUtil.startPerformanceTest("10 enum constants with vararg diamonds", this::doTest).assertTiming(); } public void testLeastUpperBoundWithLotsOfSupers() { - PlatformTestUtil.startPerformanceTest("7 unrelated intersection conjuncts", 12000, this::doTest).usesAllCPUCores().assertTiming(); + PlatformTestUtil.startPerformanceTest("7 unrelated intersection conjuncts", this::doTest).assertTiming(); } public void testVarArgPoly() { @@ -66,18 +66,18 @@ public class InferencePerformanceTest extends LightDaemonAnalyzerTestCase { int count = 70; String entries = IntStreamEx.range(count).mapToObj(i -> "entry(" + i + ", String.class)").joining(",\n "); configureFromFileText("Test.java", template.replace("$entries$", entries)); - PlatformTestUtil.startPerformanceTest(count + " arguments to Map.ofEntries", 3000, () -> doHighlighting()) + PlatformTestUtil.startPerformanceTest(count + " arguments to Map.ofEntries", () -> doHighlighting()) .setup(() -> PsiManager.getInstance(getProject()).dropPsiCaches()) - .usesAllCPUCores().assertTiming(); + .assertTiming(); assertEmpty(highlightErrors()); } public void testLongQualifierChainInsideLambda() { - PlatformTestUtil.startPerformanceTest("long qualifier chain", 12000, this::doTest).usesAllCPUCores().assertTiming(); + PlatformTestUtil.startPerformanceTest("long qualifier chain", this::doTest).assertTiming(); } public void testLongQualifierChainInsideLambdaWithOverloads() { - PlatformTestUtil.startPerformanceTest("long qualifier chain", 12000, () -> { + PlatformTestUtil.startPerformanceTest("long qualifier chain", () -> { configureByFile(BASE_PATH + "/" + getTestName(false) + ".java"); PsiMethodCallExpression callExpression = PsiTreeUtil.getParentOfType(getFile().findElementAt(getEditor().getCaretModel().getOffset()), PsiMethodCallExpression.class); @@ -117,9 +117,9 @@ public class InferencePerformanceTest extends LightDaemonAnalyzerTestCase { String entries = "foo(snippet.valueOf(foo))\n" +//to trick injection StringUtil.repeat(".foo(snippet.valueOf(foo))\n", count); configureFromFileText("Test.java", template.replace("$chain$", entries)); - PlatformTestUtil.startPerformanceTest(count + " chain in type cast", 3000, () -> doHighlighting()) + PlatformTestUtil.startPerformanceTest(count + " chain in type cast", () -> doHighlighting()) .setup(() -> PsiManager.getInstance(getProject()).dropPsiCaches()) - .usesAllCPUCores().assertTiming(); + .assertTiming(); assertEmpty(highlightErrors()); } diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/lambda/OverloadResolutionTest.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/lambda/OverloadResolutionTest.java index 56c8d30914da..676e62ca4716 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/lambda/OverloadResolutionTest.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/lambda/OverloadResolutionTest.java @@ -86,11 +86,11 @@ public class OverloadResolutionTest extends LightDaemonAnalyzerTestCase { } public void testManyOverloadsWithVarargs() { - PlatformTestUtil.startPerformanceTest("Overload resolution with 14 overloads", 10000, () -> doTest(false)).useLegacyScaling().assertTiming(); + PlatformTestUtil.startPerformanceTest("Overload resolution with 14 overloads", () -> doTest(false)).assertTiming(); } public void testConstructorOverloadsWithDiamonds() { - PlatformTestUtil.startPerformanceTest("Overload resolution with chain constructor calls with diamonds", 5000, () -> doTest(false)).useLegacyScaling().assertTiming(); + PlatformTestUtil.startPerformanceTest("Overload resolution with chain constructor calls with diamonds", () -> doTest(false)).assertTiming(); } public void testMultipleOverloadsWithNestedGeneric() { diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/psi/ControlFlowPerformanceTest.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/psi/ControlFlowPerformanceTest.java index ec520cf14bd1..b7e500914e97 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/psi/ControlFlowPerformanceTest.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/psi/ControlFlowPerformanceTest.java @@ -12,7 +12,7 @@ import one.util.streamex.StreamEx; public class ControlFlowPerformanceTest extends LightJavaCodeInsightTestCase { public void testHugeMethodChainControlFlow() { - PlatformTestUtil.startPerformanceTest(getTestName(false), 15_000, () -> { + PlatformTestUtil.startPerformanceTest(getTestName(false), () -> { int size = 2500; String source = StreamEx.constant(".toString()", size).joining("", "\"\"", ""); PsiExpression expression = JavaPsiFacade.getElementFactory(getProject()).createExpressionFromText(source, null); diff --git a/java/java-tests/testSrc/com/intellij/java/execution/filters/ConsoleViewExceptionFilterPerformanceTest.java b/java/java-tests/testSrc/com/intellij/java/execution/filters/ConsoleViewExceptionFilterPerformanceTest.java index 4b08d363f9b9..699d2a6fb22b 100644 --- a/java/java-tests/testSrc/com/intellij/java/execution/filters/ConsoleViewExceptionFilterPerformanceTest.java +++ b/java/java-tests/testSrc/com/intellij/java/execution/filters/ConsoleViewExceptionFilterPerformanceTest.java @@ -43,7 +43,7 @@ public class ConsoleViewExceptionFilterPerformanceTest extends LightJavaCodeInsi } } }"""); - PlatformTestUtil.startPerformanceTest("Many exceptions", 10_000, () -> { + PlatformTestUtil.startPerformanceTest("Many exceptions", () -> { // instantiate console with exception filters only to avoid failures due to Node/Ruby/etc dog-slow sloppy regex-based filters TextConsoleBuilder consoleBuilder = TextConsoleBuilderFactory.getInstance().createBuilder(getProject()); consoleBuilder.filters(ExceptionFilters.getFilters(GlobalSearchScope.allScope(getProject()))); diff --git a/java/java-tests/testSrc/com/intellij/java/find/FindInEditorTest.java b/java/java-tests/testSrc/com/intellij/java/find/FindInEditorTest.java index 371f503ec90e..5fae8007455f 100644 --- a/java/java-tests/testSrc/com/intellij/java/find/FindInEditorTest.java +++ b/java/java-tests/testSrc/com/intellij/java/find/FindInEditorTest.java @@ -326,7 +326,7 @@ public class FindInEditorTest extends LightPlatformCodeInsightTestCase { myFindModel.setReplaceState(true); myFindModel.setPromptOnReplace(false); - PlatformTestUtil.startPerformanceTest("replace", 45000, ()->{ + PlatformTestUtil.startPerformanceTest("replace", ()->{ for (int i=0; i<25; i++) { myFindModel. setStringToFind(aas); myFindModel.setStringToReplace(bbs); diff --git a/java/java-tests/testSrc/com/intellij/java/navigation/GotoImplementationHandlerTest.java b/java/java-tests/testSrc/com/intellij/java/navigation/GotoImplementationHandlerTest.java index 66c8bdc00640..66a282d48e4e 100644 --- a/java/java-tests/testSrc/com/intellij/java/navigation/GotoImplementationHandlerTest.java +++ b/java/java-tests/testSrc/com/intellij/java/navigation/GotoImplementationHandlerTest.java @@ -94,10 +94,10 @@ public class GotoImplementationHandlerTest extends JavaCodeInsightFixtureTestCas final PsiFile file = myFixture.addFileToProject("Foo.java", fileText); myFixture.configureFromExistingVirtualFile(file.getVirtualFile()); - PlatformTestUtil.startPerformanceTest(getTestName(false), 150, () -> { + PlatformTestUtil.startPerformanceTest(getTestName(false), () -> { PsiElement[] impls = getTargets(file); assertEquals(3, impls.length); - }).usesAllCPUCores().assertTiming(); + }).assertTiming(); } public void testToStringOnQualifiedPerformance() { @@ -125,10 +125,10 @@ public class GotoImplementationHandlerTest extends JavaCodeInsightFixtureTestCas final PsiFile file = myFixture.addFileToProject("Foo.java", fileText); myFixture.configureFromExistingVirtualFile(file.getVirtualFile()); - PlatformTestUtil.startPerformanceTest(getTestName(false), 150, () -> { + PlatformTestUtil.startPerformanceTest(getTestName(false), () -> { PsiElement[] impls = getTargets(file); assertEquals(3, impls.length); - }).usesAllCPUCores().assertTiming(); + }).assertTiming(); } public void testShowSelfNonAbstract() { diff --git a/java/java-tests/testSrc/com/intellij/java/psi/JavaReparseTest.java b/java/java-tests/testSrc/com/intellij/java/psi/JavaReparseTest.java index 25aaa403bc4b..c81693de23c9 100644 --- a/java/java-tests/testSrc/com/intellij/java/psi/JavaReparseTest.java +++ b/java/java-tests/testSrc/com/intellij/java/psi/JavaReparseTest.java @@ -293,7 +293,7 @@ public class JavaReparseTest extends AbstractReparseTestCase { Document document = pdm.getDocument(file); WriteCommandAction.runWriteCommandAction(getProject(), () -> { - PlatformTestUtil.startPerformanceTest("deep reparse", 200, () -> { + PlatformTestUtil.startPerformanceTest("deep reparse", () -> { document.insertString(document.getTextLength() - suffix.length(), call1); pdm.commitDocument(document); diff --git a/java/java-tests/testSrc/com/intellij/java/psi/JavaStubBuilderTest.java b/java/java-tests/testSrc/com/intellij/java/psi/JavaStubBuilderTest.java index 7a180fa77e9b..0116f682003c 100644 --- a/java/java-tests/testSrc/com/intellij/java/psi/JavaStubBuilderTest.java +++ b/java/java-tests/testSrc/com/intellij/java/psi/JavaStubBuilderTest.java @@ -831,7 +831,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, 700, () -> myBuilder.buildStubTree(file)).assertTiming(); + PlatformTestUtil.startPerformanceTest(message, () -> myBuilder.buildStubTree(file)).assertTiming(); } private void doTest(/*@Language("JAVA")*/ String source, @Language("TEXT") String expected) { diff --git a/java/java-tests/testSrc/com/intellij/java/psi/codeStyle/autodetect/JavaAutoDetectIndentPerformanceTest.java b/java/java-tests/testSrc/com/intellij/java/psi/codeStyle/autodetect/JavaAutoDetectIndentPerformanceTest.java index 9a498187d59a..830788db87ae 100644 --- a/java/java-tests/testSrc/com/intellij/java/psi/codeStyle/autodetect/JavaAutoDetectIndentPerformanceTest.java +++ b/java/java-tests/testSrc/com/intellij/java/psi/codeStyle/autodetect/JavaAutoDetectIndentPerformanceTest.java @@ -63,8 +63,7 @@ public class JavaAutoDetectIndentPerformanceTest extends AbstractIndentAutoDetec detectIndentOptions(getVFile(), getEditor().getDocument()); PlatformTestUtil - .startPerformanceTest("Detecting indent on hot file", 180, - () -> detectIndentOptions(getVFile(), getEditor().getDocument())) + .startPerformanceTest("Detecting indent on hot file", () -> detectIndentOptions(getVFile(), getEditor().getDocument())) .assertTiming(); } diff --git a/java/java-tests/testSrc/com/intellij/java/psi/formatter/java/JavaEnterActionTest.java b/java/java-tests/testSrc/com/intellij/java/psi/formatter/java/JavaEnterActionTest.java index c66af8201c7f..130508b16884 100644 --- a/java/java-tests/testSrc/com/intellij/java/psi/formatter/java/JavaEnterActionTest.java +++ b/java/java-tests/testSrc/com/intellij/java/psi/formatter/java/JavaEnterActionTest.java @@ -1131,7 +1131,7 @@ public class JavaEnterActionTest extends AbstractBasicJavaEnterActionTest { public void testPerformance() { configureByFile("/codeInsight/enterAction/Performance.java"); - PlatformTestUtil.startPerformanceTest("enter in " + getFile(), 200, () -> { + PlatformTestUtil.startPerformanceTest("enter in " + getFile(), () -> { performAction(); deleteLine(); caretUp(); @@ -1145,6 +1145,6 @@ public class JavaEnterActionTest extends AbstractBasicJavaEnterActionTest { " u." + StringUtil.repeat("\n a('b').c(new Some()).", 500)) + "\n" + " x(); } }"); - PlatformTestUtil.startPerformanceTest("enter", 1500, this::performAction).assertTiming(); + PlatformTestUtil.startPerformanceTest("enter", this::performAction).assertTiming(); } } \ No newline at end of file diff --git a/java/java-tests/testSrc/com/intellij/java/psi/formatter/performance/JavaFormatterPerformanceTest.java b/java/java-tests/testSrc/com/intellij/java/psi/formatter/performance/JavaFormatterPerformanceTest.java index 1d127a465ac6..654af963558d 100644 --- a/java/java-tests/testSrc/com/intellij/java/psi/formatter/performance/JavaFormatterPerformanceTest.java +++ b/java/java-tests/testSrc/com/intellij/java/psi/formatter/performance/JavaFormatterPerformanceTest.java @@ -45,7 +45,7 @@ public class JavaFormatterPerformanceTest extends JavaFormatterTestCase { FormatterImpl formatter = (FormatterImpl)FormatterEx.getInstanceEx(); CommonCodeStyleSettings.IndentOptions options = settings.getIndentOptions(JavaFileType.INSTANCE); - PlatformTestUtil.startPerformanceTest("Java Formatting [1]", 5000, () -> { + PlatformTestUtil.startPerformanceTest("Java Formatting [1]", () -> { FormattingModel model = LanguageFormatting.INSTANCE.forContext(file).createModel(FormattingContext.create(file, settings)); formatter.formatWithoutModifications(model.getDocumentModel(), model.getRootBlock(), settings, options, file.getTextRange()); @@ -58,7 +58,7 @@ public class JavaFormatterPerformanceTest extends JavaFormatterTestCase { public void testPerformance2() { getSettings().setDefaultRightMargin(120); - PlatformTestUtil.startPerformanceTest("Java Formatting [2]", 8000, () -> doTest()) + PlatformTestUtil.startPerformanceTest("Java Formatting [2]", () -> doTest()) .warmupIterations(5) .attempts(20) .assertTiming(); @@ -76,7 +76,7 @@ public class JavaFormatterPerformanceTest extends JavaFormatterTestCase { indentOptions.USE_TAB_CHARACTER = true; indentOptions.TAB_SIZE = 4; - PlatformTestUtil.startPerformanceTest("Java Formatting [3]", 3000, () -> doTest()) + PlatformTestUtil.startPerformanceTest("Java Formatting [3]", () -> doTest()) .warmupIterations(100) .attempts(300) .assertTiming(); diff --git a/java/java-tests/testSrc/com/intellij/java/psi/formatter/performance/JavaSmartReformatPerformanceTest.java b/java/java-tests/testSrc/com/intellij/java/psi/formatter/performance/JavaSmartReformatPerformanceTest.java index 9fbc14f657b9..f92c3f2b82cd 100644 --- a/java/java-tests/testSrc/com/intellij/java/psi/formatter/performance/JavaSmartReformatPerformanceTest.java +++ b/java/java-tests/testSrc/com/intellij/java/psi/formatter/performance/JavaSmartReformatPerformanceTest.java @@ -42,7 +42,7 @@ public class JavaSmartReformatPerformanceTest extends AbstractJavaFormatterTest }; PlatformTestUtil - .startPerformanceTest("smart reformat on big file", 500, test) + .startPerformanceTest("smart reformat on big file", test) .setup(setup) .warmupIterations(50) .attempts(100) diff --git a/java/java-tests/testSrc/com/intellij/java/psi/resolve/ResolvePerformanceTest.java b/java/java-tests/testSrc/com/intellij/java/psi/resolve/ResolvePerformanceTest.java index 10371a6d1219..a50875753dca 100644 --- a/java/java-tests/testSrc/com/intellij/java/psi/resolve/ResolvePerformanceTest.java +++ b/java/java-tests/testSrc/com/intellij/java/psi/resolve/ResolvePerformanceTest.java @@ -106,7 +106,7 @@ public class ResolvePerformanceTest extends JavaResolveTestCase { PsiReference ref = configureByFile("class/" + getTestName(false) + ".java"); ensureIndexUpToDate(); - PlatformTestUtil.startPerformanceTest(getTestName(false), 150, () -> assertNull(ref.resolve())) + PlatformTestUtil.startPerformanceTest(getTestName(false), () -> assertNull(ref.resolve())) .warmupIterations(20) .attempts(50) .assertTiming(); @@ -131,7 +131,7 @@ public class ResolvePerformanceTest extends JavaResolveTestCase { List refs = SyntaxTraverser.psiTraverser(file).filter(PsiJavaCodeReferenceElement.class).toList(); - PlatformTestUtil.startPerformanceTest(getTestName(false), 1_000, () -> { + PlatformTestUtil.startPerformanceTest(getTestName(false), () -> { for (PsiJavaCodeReferenceElement ref : refs) { assertNotNull(ref.resolve()); } @@ -173,7 +173,7 @@ public class ResolvePerformanceTest extends JavaResolveTestCase { } ensureIndexUpToDate(); - PlatformTestUtil.startPerformanceTest(getTestName(false), 800, () -> assertNull(ref.resolve())) + PlatformTestUtil.startPerformanceTest(getTestName(false), () -> assertNull(ref.resolve())) .warmupIterations(20) .attempts(50) .assertTiming(); @@ -181,7 +181,7 @@ public class ResolvePerformanceTest extends JavaResolveTestCase { } public void testLongIdentifierDotChain() { - PlatformTestUtil.startPerformanceTest(getTestName(false), 800, () -> { + PlatformTestUtil.startPerformanceTest(getTestName(false), () -> { PsiFile file = createDummyFile("a.java", "class C { { " + StringUtil.repeat("obj.", 100) + "foo } }"); PsiReference ref = file.findReferenceAt(file.getText().indexOf("foo")); assertNull(ref.resolve()); diff --git a/java/java-tests/testSrc/com/intellij/psi/impl/smartPointers/SmartPsiElementPointersTest.java b/java/java-tests/testSrc/com/intellij/psi/impl/smartPointers/SmartPsiElementPointersTest.java index 64da0fdb5b65..de40e1c63c4a 100644 --- a/java/java-tests/testSrc/com/intellij/psi/impl/smartPointers/SmartPsiElementPointersTest.java +++ b/java/java-tests/testSrc/com/intellij/psi/impl/smartPointers/SmartPsiElementPointersTest.java @@ -682,7 +682,7 @@ public class SmartPsiElementPointersTest extends JavaCodeInsightTestCase { final Document document = file.getViewProvider().getDocument(); assertNotNull(document); - WriteAction.run(() -> PlatformTestUtil.startPerformanceTest("smart pointer range update", 10_000, () -> { + WriteAction.run(() -> PlatformTestUtil.startPerformanceTest("smart pointer range update", () -> { for (int i = 0; i < 10000; i++) { document.insertString(i * 20 + 100, "x\n"); assertFalse(PsiDocumentManager.getInstance(myProject).isCommitted(document)); @@ -882,7 +882,7 @@ public class SmartPsiElementPointersTest extends JavaCodeInsightTestCase { XmlFile file = (XmlFile)createFile("a.xml", "\n" + StringUtil.repeat(eachTag, 500) + ""); List tags = new ArrayList<>(PsiTreeUtil.findChildrenOfType(file.getDocument(), XmlTag.class)); List pointers = ContainerUtil.map(tags, this::createPointer); - ApplicationManager.getApplication().runWriteAction(() -> PlatformTestUtil.startPerformanceTest("smart pointer range update after PSI change", 21000, () -> { + ApplicationManager.getApplication().runWriteAction(() -> PlatformTestUtil.startPerformanceTest("smart pointer range update after PSI change", () -> { for (int i = 0; i < tags.size(); i++) { XmlTag tag = tags.get(i); SmartPsiElementPointer pointer = pointers.get(i); @@ -894,7 +894,7 @@ public class SmartPsiElementPointersTest extends JavaCodeInsightTestCase { assertEquals(tag.getName().length(), TextRange.create(pointer.getPsiRange()).getLength()); } PostprocessReformattingAspect.getInstance(myProject).doPostponedFormatting(); - }).useLegacyScaling().assertTiming()); + }).assertTiming()); } @NotNull @@ -949,7 +949,7 @@ public class SmartPsiElementPointersTest extends JavaCodeInsightTestCase { String text = StringUtil.repeatSymbol(' ', 100000); PsiFile file = createFile("a.txt", text); - PlatformTestUtil.startPerformanceTest(getTestName(false), 650, () -> { + PlatformTestUtil.startPerformanceTest(getTestName(false), () -> { List pointers = new ArrayList<>(); for (int i = 0; i < text.length() - 1; i++) { pointers.add(getPointerManager().createSmartPsiFileRangePointer(file, new TextRange(i, i + 1))); diff --git a/java/java-tests/testSrc/com/intellij/roots/RootsChangedTest.java b/java/java-tests/testSrc/com/intellij/roots/RootsChangedTest.java index 90611ac257fd..f52bba83fc6d 100644 --- a/java/java-tests/testSrc/com/intellij/roots/RootsChangedTest.java +++ b/java/java-tests/testSrc/com/intellij/roots/RootsChangedTest.java @@ -407,7 +407,7 @@ public class RootsChangedTest extends JavaModuleTestCase { VirtualFile xxx = createChildDirectory(temp, dirName); - PlatformTestUtil.startPerformanceTest("time wasted in ProjectRootManagerComponent.before/afterValidityChanged()", 10000, ()->{ + PlatformTestUtil.startPerformanceTest("time wasted in ProjectRootManagerComponent.before/afterValidityChanged()", ()->{ for (int i = 0; i < 100; i++) { rename(xxx, "yyy"); rename(xxx, dirName); diff --git a/java/java-tests/testSrc/com/intellij/unscramble/ThreadDumpParserTest.groovy b/java/java-tests/testSrc/com/intellij/unscramble/ThreadDumpParserTest.groovy index 33a9a036b2d2..c8cc41d08633 100644 --- a/java/java-tests/testSrc/com/intellij/unscramble/ThreadDumpParserTest.groovy +++ b/java/java-tests/testSrc/com/intellij/unscramble/ThreadDumpParserTest.groovy @@ -373,12 +373,12 @@ Thread 7381: (state = BLOCKED) void "test very long line parsing performance"() { def spaces = ' ' * 1_000_000 def letters = 'a' * 1_000_000 - PlatformTestUtil.startPerformanceTest('parsing spaces', 100, { + PlatformTestUtil.startPerformanceTest('parsing spaces', { def threads = ThreadDumpParser.parse(spaces) assert threads.empty }).assertTimingAsSubtest() - PlatformTestUtil.startPerformanceTest('parsing letters', 100, { + PlatformTestUtil.startPerformanceTest('parsing letters', { def threads = ThreadDumpParser.parse(letters) assert threads.empty }).assertTimingAsSubtest() diff --git a/java/java-tests/testSrc/com/intellij/util/indexing/IndexTest.java b/java/java-tests/testSrc/com/intellij/util/indexing/IndexTest.java index 45748934f9ea..2530de086e13 100644 --- a/java/java-tests/testSrc/com/intellij/util/indexing/IndexTest.java +++ b/java/java-tests/testSrc/com/intellij/util/indexing/IndexTest.java @@ -965,7 +965,7 @@ public class IndexTest extends JavaCodeInsightFixtureTestCase { final String filename = "A.java"; myFixture.addFileToProject("foo/bar/" + filename, "class A {}"); - PlatformTestUtil.startPerformanceTest("Vfs Event Processing By Index", 1000, () -> { + PlatformTestUtil.startPerformanceTest("Vfs Event Processing By Index", () -> { PsiFile[] files = FilenameIndex.getFilesByName(getProject(), filename, GlobalSearchScope.moduleScope(getModule())); assertEquals(1, files.length); diff --git a/json/tests/test/com/intellij/json/JsonFormattingTest.java b/json/tests/test/com/intellij/json/JsonFormattingTest.java index 0edf49d96f6f..51d1bebedbcd 100644 --- a/json/tests/test/com/intellij/json/JsonFormattingTest.java +++ b/json/tests/test/com/intellij/json/JsonFormattingTest.java @@ -99,7 +99,7 @@ public class JsonFormattingTest extends JsonTestCase { public void testHugeJsonFile() { // IDEA-195340 bad JSON kills IntelliJ myFixture.configureByFile(getTestName(false) + ".json"); - PlatformTestUtil.startPerformanceTest(getTestName(false), 5000, this::reformatAndCheck).attempts(1).usesAllCPUCores().assertTiming(); + PlatformTestUtil.startPerformanceTest(getTestName(false), this::reformatAndCheck).attempts(1).assertTiming(); } private void doTest() { diff --git a/json/tests/test/com/jetbrains/jsonSchema/JsonSchemaPerformanceTest.java b/json/tests/test/com/jetbrains/jsonSchema/JsonSchemaPerformanceTest.java index d7a8fb1a6dba..7ec3725a306f 100644 --- a/json/tests/test/com/jetbrains/jsonSchema/JsonSchemaPerformanceTest.java +++ b/json/tests/test/com/jetbrains/jsonSchema/JsonSchemaPerformanceTest.java @@ -74,14 +74,14 @@ public class JsonSchemaPerformanceTest extends JsonSchemaHeavyAbstractTest { myFixture.doHighlighting(); } }); - PlatformTestUtil.startPerformanceTest(getTestName(false), expectedMs, test).usesAllCPUCores().assertTiming(); + PlatformTestUtil.startPerformanceTest(getTestName(false), test).assertTiming(); } public void testEslintHighlightingPerformance() { myFixture.configureByFile(getTestName(true) + "/.eslintrc.json"); PsiFile psiFile = myFixture.getFile(); - PlatformTestUtil.startPerformanceTest(getTestName(true), (int)TimeUnit.SECONDS.toMillis(15), () -> { + PlatformTestUtil.startPerformanceTest(getTestName(true), () -> { for (int i = 0; i < 10; i++) { myFixture.doHighlighting(); diff --git a/json/tests/test/com/jetbrains/jsonSchema/remote/JsonSchemaCatalogManagerTest.java b/json/tests/test/com/jetbrains/jsonSchema/remote/JsonSchemaCatalogManagerTest.java index d01d24c4e733..cbb80f962c78 100644 --- a/json/tests/test/com/jetbrains/jsonSchema/remote/JsonSchemaCatalogManagerTest.java +++ b/json/tests/test/com/jetbrains/jsonSchema/remote/JsonSchemaCatalogManagerTest.java @@ -55,12 +55,12 @@ public class JsonSchemaCatalogManagerTest extends BasePlatformTestCase { VirtualFile file = myFixture.addFileToProject("some/unknown.json", "").getVirtualFile(); VirtualFile schemaFile = myCatalogManager.getSchemaFileForFile(file); Assert.assertNull(schemaFile); - PlatformTestUtil.startPerformanceTest(getTestName(false), 2000, () -> { + PlatformTestUtil.startPerformanceTest(getTestName(false), () -> { for (int i = 0; i < 1000000; i++) { VirtualFile result = myCatalogManager.getSchemaFileForFile(file); Assert.assertNull(result); } - }).usesAllCPUCores().assertTiming(); + }).assertTiming(); } private void doTest(@NotNull String filePath, @Nullable String expectedSchemaUrl) { diff --git a/platform/diff-impl/tests/testSrc/com/intellij/diff/util/DiffPerformanceTest.kt b/platform/diff-impl/tests/testSrc/com/intellij/diff/util/DiffPerformanceTest.kt index 17d77ef0a801..3ff0d415f3c3 100644 --- a/platform/diff-impl/tests/testSrc/com/intellij/diff/util/DiffPerformanceTest.kt +++ b/platform/diff-impl/tests/testSrc/com/intellij/diff/util/DiffPerformanceTest.kt @@ -64,19 +64,19 @@ class DiffPerformanceTest : TestCase() { } fun `test altered 200000`() { - testCpu(3, 550) { + testCpu(3) { Diff.buildChanges(arr_200000, altered_200000) } } fun `test heavy altered 200000`() { - testCpu(1, 3500) { + testCpu(1) { Diff.buildChanges(arr_200000, heavy_altered_200000) } } fun `test reversed 50000 failure`() { - testCpu(1, 10_000) { + testCpu(1) { try { Diff.buildChanges(arr_50000, reversed_50000) } @@ -88,103 +88,103 @@ class DiffPerformanceTest : TestCase() { } fun `test reversed 5000`() { - testCpu(1, 2500) { + testCpu(1) { Diff.buildChanges(arr_5000, reversed_5000) } } fun `test altered 50000`() { - testCpu(20, 650) { + testCpu(20) { Diff.buildChanges(arr_50000, altered_50000) } } fun `test heavy altered 50000`() { - testCpu(3, 750) { + testCpu(3) { Diff.buildChanges(arr_50000, heavy_altered_50000) } } fun `test altered 20000`() { - testCpu(20, 350) { + testCpu(20) { Diff.buildChanges(arr_20000, altered_20000) } } fun `test heavy altered 20000`() { - testCpu(15, 650) { + testCpu(15) { Diff.buildChanges(arr_20000, heavy_altered_20000) } } fun `test altered 2000`() { - testCpu(400, 550) { + testCpu(400) { Diff.buildChanges(arr_2000, altered_2000) } } fun `test heavy altered 2000`() { - testCpu(400, 650) { + testCpu(400) { Diff.buildChanges(arr_2000, heavy_altered_2000) } } fun `test shuffled 2000`() { - testCpu(1, 650) { + testCpu(1) { Diff.buildChanges(arr_2000, shuffled_2000) } } fun `test reversed 2000`() { - testCpu(1, 550) { + testCpu(1) { Diff.buildChanges(arr_2000, reversed_2000) } } fun `test altered 1000`() { - testCpu(700, 450) { + testCpu(700) { Diff.buildChanges(arr_1000, altered_1000) } } fun `test heavy altered 1000`() { - testCpu(700, 550) { + testCpu(700) { Diff.buildChanges(arr_1000, heavy_altered_1000) } } fun `test shuffled 1000`() { - testCpu(10, 850) { + testCpu(10) { Diff.buildChanges(arr_1000, shuffled_1000) } } fun `test reversed 1000`() { - testCpu(10, 750) { + testCpu(10) { Diff.buildChanges(arr_1000, reversed_1000) } } fun `test altered 100`() { - testCpu(10000, 600) { + testCpu(10000) { Diff.buildChanges(arr_100, altered_100) } } fun `test heavy altered 100`() { - testCpu(10000, 650) { + testCpu(10000) { Diff.buildChanges(arr_100, heavy_altered_100) } } fun `test shuffled 100`() { - testCpu(2000, 550) { + testCpu(2000) { Diff.buildChanges(arr_100, shuffled_100) } } fun `test reversed 100`() { - testCpu(1000, 650) { + testCpu(1000) { Diff.buildChanges(arr_100, reversed_100) } } @@ -219,8 +219,8 @@ class DiffPerformanceTest : TestCase() { } - private inline fun testCpu(iterations: Int, expectedMs: Int, crossinline test: () -> Unit) { - PlatformTestUtil.startPerformanceTest(PlatformTestUtil.getTestName(name, true), expectedMs) { + private inline fun testCpu(iterations: Int, crossinline test: () -> Unit) { + PlatformTestUtil.startPerformanceTest(PlatformTestUtil.getTestName(name, true)) { for (i in 0..iterations) { test() } diff --git a/platform/lang-impl/testSources/com/intellij/find/FindInEditorPerformanceTest.java b/platform/lang-impl/testSources/com/intellij/find/FindInEditorPerformanceTest.java index 50593bccbb23..f243de550e7e 100644 --- a/platform/lang-impl/testSources/com/intellij/find/FindInEditorPerformanceTest.java +++ b/platform/lang-impl/testSources/com/intellij/find/FindInEditorPerformanceTest.java @@ -11,7 +11,7 @@ public class FindInEditorPerformanceTest extends AbstractFindInEditorTest { setTextToFind("s"); assertEquals(9999 + 1 /* cursor highlighting */, getEditor().getMarkupModel().getAllHighlighters().length); getEditor().getCaretModel().moveToOffset(0); - PlatformTestUtil.startPerformanceTest("typing in editor when a lot of search results are highlighted", 20000, () -> { + PlatformTestUtil.startPerformanceTest("typing in editor when a lot of search results are highlighted", () -> { for (int i = 0; i < 100; i++) { myFixture.type(' '); } diff --git a/platform/platform-tests/testSrc/com/intellij/codeInsight/PlainTextEditingTest.java b/platform/platform-tests/testSrc/com/intellij/codeInsight/PlainTextEditingTest.java index ea5ef9a43c31..57d5950b3933 100644 --- a/platform/platform-tests/testSrc/com/intellij/codeInsight/PlainTextEditingTest.java +++ b/platform/platform-tests/testSrc/com/intellij/codeInsight/PlainTextEditingTest.java @@ -301,7 +301,7 @@ public class PlainTextEditingTest extends EditingTestBase { public void testCalculatingLongLinesPositionPerformanceInEditorWithNoTabs() { final String longLine = StringUtil.repeatSymbol(' ', 1000000); configureFromFileText("x.txt", longLine); - PlatformTestUtil.startPerformanceTest("calcOffset", 10, () -> { + PlatformTestUtil.startPerformanceTest("calcOffset", () -> { for (int i = 0; i < 1000; i++) { int off = getEditor().logicalPositionToOffset(new LogicalPosition(0, longLine.length() - 1)); assertEquals(longLine.length() - 1, off); diff --git a/platform/platform-tests/testSrc/com/intellij/execution/filters/UrlFilterTest.java b/platform/platform-tests/testSrc/com/intellij/execution/filters/UrlFilterTest.java index 32ca699c59e3..665ac38066e7 100644 --- a/platform/platform-tests/testSrc/com/intellij/execution/filters/UrlFilterTest.java +++ b/platform/platform-tests/testSrc/com/intellij/execution/filters/UrlFilterTest.java @@ -44,7 +44,7 @@ public class UrlFilterTest extends BasePlatformTestCase { public void testPerformanceSimple() { List expected = List.of(new FileLinkInfo(7, 30, "/home/file.txt", 3, 1), new FileLinkInfo(34, 62, "/home/result.txt", 3, 30)); - PlatformTestUtil.startPerformanceTest("Find file hyperlinks", 3000, () -> { + PlatformTestUtil.startPerformanceTest("Find file hyperlinks", () -> { for (int i = 0; i < 100_000; i++) { Filter.Result result = applyFilter("before file:///home/file.txt:3 -> file:///home/result.txt:3:30 after"); assertHyperlinks(result, expected); diff --git a/platform/platform-tests/testSrc/com/intellij/execution/impl/ConsoleViewImplTest.java b/platform/platform-tests/testSrc/com/intellij/execution/impl/ConsoleViewImplTest.java index b3e9ccf955cf..5cefe0e692ce 100644 --- a/platform/platform-tests/testSrc/com/intellij/execution/impl/ConsoleViewImplTest.java +++ b/platform/platform-tests/testSrc/com/intellij/execution/impl/ConsoleViewImplTest.java @@ -268,7 +268,7 @@ public class ConsoleViewImplTest extends LightPlatformTestCase { public void testPerformance() { withCycleConsoleNoFolding(100, console -> - PlatformTestUtil.startPerformanceTest("console print", 15000, () -> { + PlatformTestUtil.startPerformanceTest("console print", () -> { console.clear(); for (int i=0; i<10_000_000; i++) { console.print("xxx\n", ConsoleViewContentType.NORMAL_OUTPUT); @@ -282,7 +282,7 @@ public class ConsoleViewImplTest extends LightPlatformTestCase { public void testLargeConsolePerformance() { withCycleConsoleNoFolding(UISettings.getInstance().getConsoleCycleBufferSizeKb(), console -> - PlatformTestUtil.startPerformanceTest("console print", 15_000, () -> { + PlatformTestUtil.startPerformanceTest("console print", () -> { console.clear(); for (int i=0; i<20_000_000; i++) { console.print("hello\n", ConsoleViewContentType.NORMAL_OUTPUT); @@ -294,7 +294,7 @@ public class ConsoleViewImplTest extends LightPlatformTestCase { public void testPerformanceOfMergeableTokens() { withCycleConsoleNoFolding(1000, console -> - PlatformTestUtil.startPerformanceTest("console print with mergeable tokens", 3500, () -> { + PlatformTestUtil.startPerformanceTest("console print with mergeable tokens", () -> { console.clear(); for (int i=0; i<10_000_000; i++) { console.print("xxx\n", ConsoleViewContentType.NORMAL_OUTPUT); @@ -696,7 +696,7 @@ public class ConsoleViewImplTest extends LightPlatformTestCase { public void testBackspacePerformance() { int nCopies = 10000; String in = StringUtil.repeat("\na\nb\bc", nCopies); - PlatformTestUtil.startPerformanceTest("print newlines with backspace", 5000, () -> { + PlatformTestUtil.startPerformanceTest("print newlines with backspace", () -> { for (int i = 0; i < 2; i++) { myConsole.clear(); int printCount = ConsoleBuffer.getCycleBufferSize() / in.length(); diff --git a/platform/platform-tests/testSrc/com/intellij/execution/impl/MockProcessStreamsSynchronizerTest.java b/platform/platform-tests/testSrc/com/intellij/execution/impl/MockProcessStreamsSynchronizerTest.java index df22fc353882..1935de289d83 100644 --- a/platform/platform-tests/testSrc/com/intellij/execution/impl/MockProcessStreamsSynchronizerTest.java +++ b/platform/platform-tests/testSrc/com/intellij/execution/impl/MockProcessStreamsSynchronizerTest.java @@ -96,7 +96,7 @@ public class MockProcessStreamsSynchronizerTest extends LightPlatformTestCase { } public void testPerformanceSingleStream() { - PlatformTestUtil.startPerformanceTest("single stream", 30000, () -> { + PlatformTestUtil.startPerformanceTest("single stream", () -> { mySynchronizer = new MockProcessStreamsSynchronizer(getTestRootDisposable()); long nowTimeMillis = 10; for (int i = 0; i < 10_000_000; i++) { @@ -120,7 +120,7 @@ public class MockProcessStreamsSynchronizerTest extends LightPlatformTestCase { } public void testPerformanceTwoStreams() { - PlatformTestUtil.startPerformanceTest("two streams", 30000, () -> { + PlatformTestUtil.startPerformanceTest("two streams", () -> { mySynchronizer = new MockProcessStreamsSynchronizer(getTestRootDisposable()); long nowTimeMillis = 10; for (int i = 0; i < 10_000_000; i++) { diff --git a/platform/platform-tests/testSrc/com/intellij/execution/process/AnsiEscapeDecoderTest.java b/platform/platform-tests/testSrc/com/intellij/execution/process/AnsiEscapeDecoderTest.java index 03c6d29af955..01f68a5cc722 100644 --- a/platform/platform-tests/testSrc/com/intellij/execution/process/AnsiEscapeDecoderTest.java +++ b/platform/platform-tests/testSrc/com/intellij/execution/process/AnsiEscapeDecoderTest.java @@ -287,7 +287,7 @@ public class AnsiEscapeDecoderTest extends LightPlatformTestCase { //noinspection CodeBlock2Expr withProcessHandlerFrom(testProcess, handler -> { - PlatformTestUtil.startPerformanceTest("ansi color", 8_500, () -> { + PlatformTestUtil.startPerformanceTest("ansi color", () -> { for (int i = 0; i < 2_000_000; i++) { handler.notifyTextAvailable(i + "Chrome 35.0.1916 (Linux): Executed 0 of 1\u001B[32m SUCCESS\u001B[39m (0 secs / 0 secs)\n", ProcessOutputTypes.STDOUT); diff --git a/platform/platform-tests/testSrc/com/intellij/history/integration/LocalHistoryStorageTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/LocalHistoryStorageTest.java index adb164a93ac8..2a19782b2c4d 100644 --- a/platform/platform-tests/testSrc/com/intellij/history/integration/LocalHistoryStorageTest.java +++ b/platform/platform-tests/testSrc/com/intellij/history/integration/LocalHistoryStorageTest.java @@ -41,7 +41,7 @@ public class LocalHistoryStorageTest extends IntegrationTestCase { () -> VirtualFileManager.getInstance().findFileByUrl("temp:///").createChildData(null, "testChangesAccumulationPerformance.txt") ); try { - PlatformTestUtil.startPerformanceTest("local history changes accumulation", 1800, () -> { + PlatformTestUtil.startPerformanceTest("local history changes accumulation", () -> { doChangesAccumulationPerformanceTest(f); }).assertTiming(); } diff --git a/platform/platform-tests/testSrc/com/intellij/ide/IdeEventQueueTest.java b/platform/platform-tests/testSrc/com/intellij/ide/IdeEventQueueTest.java index 7f8c75c601db..97da7cfe7fef 100644 --- a/platform/platform-tests/testSrc/com/intellij/ide/IdeEventQueueTest.java +++ b/platform/platform-tests/testSrc/com/intellij/ide/IdeEventQueueTest.java @@ -34,7 +34,7 @@ import java.util.concurrent.atomic.AtomicInteger; public class IdeEventQueueTest extends LightPlatformTestCase { public void testManyEventsStress() { int N = 100000; - PlatformTestUtil.startPerformanceTest("Event queue dispatch", 10000, () -> { + PlatformTestUtil.startPerformanceTest("Event queue dispatch", () -> { UIUtil.dispatchAllInvocationEvents(); AtomicInteger count = new AtomicInteger(); for (int i = 0; i < N; i++) { diff --git a/platform/platform-tests/testSrc/com/intellij/ide/highlighter/custom/CustomFileTypeLexerTest.kt b/platform/platform-tests/testSrc/com/intellij/ide/highlighter/custom/CustomFileTypeLexerTest.kt index 962c3649c9d1..a9407a0dd9be 100644 --- a/platform/platform-tests/testSrc/com/intellij/ide/highlighter/custom/CustomFileTypeLexerTest.kt +++ b/platform/platform-tests/testSrc/com/intellij/ide/highlighter/custom/CustomFileTypeLexerTest.kt @@ -508,7 +508,7 @@ NUMBER ('0yabc0') } } - PlatformTestUtil.startPerformanceTest(name, 300) { + PlatformTestUtil.startPerformanceTest(name) { val charAts = IntRef() LexerTestCase.printTokens(countingCharSequence(text, charAts), 0, CustomFileTypeLexer(table)) assertTrue(charAts.get() < text.length * 4) diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/application/impl/ApplicationImplTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/application/impl/ApplicationImplTest.java index a1353861be03..55da1ce74452 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/application/impl/ApplicationImplTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/application/impl/ApplicationImplTest.java @@ -60,14 +60,14 @@ public class ApplicationImplTest extends LightPlatformTestCase { private volatile Throwable exception; public void testRead50Write50LockPerformance() { - runReadWrites(500_000, 500_000, 2000); + runReadWrites(500_000, 500_000); } public void testRead100Write0LockPerformance() { - runReadWrites(50_000_000, 0, 10_000); + runReadWrites(50_000_000, 0); } - private void runReadWrites(final int readIterations, final int writeIterations, int expectedMs) { + private void runReadWrites(final int readIterations, final int writeIterations) { NonBlockingReadActionImpl.waitForAsyncTaskCompletion(); // someone might've submitted a task depending on app events which we disable now final ApplicationImpl application = (ApplicationImpl)ApplicationManager.getApplication(); Disposable disposable = Disposer.newDisposable(); @@ -75,7 +75,7 @@ public class ApplicationImplTest extends LightPlatformTestCase { ThreadingAssertions.assertEventDispatchThread(); try { - PlatformTestUtil.startPerformanceTest("lock/unlock "+getTestName(false), expectedMs, () -> { + PlatformTestUtil.startPerformanceTest("lock/unlock "+getTestName(false), () -> { final int numOfThreads = JobSchedulerImpl.getJobPoolParallelism(); List> threads = new ArrayList<>(numOfThreads); for (int i = 0; i < numOfThreads; i++) { @@ -475,7 +475,7 @@ public class ApplicationImplTest extends LightPlatformTestCase { } }); - PlatformTestUtil.startPerformanceTest("RWLock/unlock", 27_000, ()-> { + PlatformTestUtil.startPerformanceTest("RWLock/unlock", ()-> { ThreadingAssertions.assertEventDispatchThread(); assertFalse(ApplicationManager.getApplication().isWriteAccessAllowed()); List> futures = AppExecutorUtil.getAppExecutorService().invokeAll(callables); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/application/impl/LaterInvocatorTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/application/impl/LaterInvocatorTest.java index 28bd69c337ec..a7a903aba54d 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/application/impl/LaterInvocatorTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/application/impl/LaterInvocatorTest.java @@ -590,7 +590,7 @@ public class LaterInvocatorTest extends HeavyPlatformTestCase { AtomicInteger counter = new AtomicInteger(); Runnable r = () -> counter.incrementAndGet(); - PlatformTestUtil.startPerformanceTest(getTestName(false), 20_000, () -> { + PlatformTestUtil.startPerformanceTest(getTestName(false), () -> { for (int i = 0; i < N; i++) { if (i % 8192 == 0) { // decrease GC pressure, we're not measuring that @@ -608,7 +608,7 @@ public class LaterInvocatorTest extends HeavyPlatformTestCase { int N = 1_000_000; AtomicInteger counter = new AtomicInteger(); Runnable r = () -> counter.incrementAndGet(); - PlatformTestUtil.startPerformanceTest(getTestName(false), 800, () -> { + PlatformTestUtil.startPerformanceTest(getTestName(false), () -> { Application application = ApplicationManager.getApplication(); for (int i = 0; i < N; i++) { if (i % 8192 == 0) { @@ -629,7 +629,7 @@ public class LaterInvocatorTest extends HeavyPlatformTestCase { Runnable r = () -> counter.incrementAndGet(); Application application = ApplicationManager.getApplication(); application.invokeAndWait(r); - PlatformTestUtil.startPerformanceTest(getTestName(false), 900, () -> { + PlatformTestUtil.startPerformanceTest(getTestName(false), () -> { counter.set(0); UIUtil.invokeAndWaitIfNeeded(() -> LaterInvocator.enterModal(myWindow1)); for (int i = 0; i < N; i++) { diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/application/impl/NonBlockingReadActionTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/application/impl/NonBlockingReadActionTest.java index 97d2a91c25d4..6299a9413883 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/application/impl/NonBlockingReadActionTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/application/impl/NonBlockingReadActionTest.java @@ -401,7 +401,7 @@ public class NonBlockingReadActionTest extends LightPlatformTestCase { } public void testCancellationPerformance() { - PlatformTestUtil.startPerformanceTest("NBRA cancellation", 500, () -> { + PlatformTestUtil.startPerformanceTest("NBRA cancellation", () -> { WriteAction.run(() -> { for (int i = 0; i < 100_000; i++) { ReadAction.nonBlocking(() -> {}).coalesceBy(this).submit(AppExecutorUtil.getAppExecutorService()).cancel(); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorCreationPerformanceTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorCreationPerformanceTest.java index c19c66f7b99f..f7f671341c75 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorCreationPerformanceTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorCreationPerformanceTest.java @@ -24,7 +24,7 @@ public class EditorCreationPerformanceTest extends AbstractEditorTest { public void testOpeningEditorWithManyLines() { Document document = EditorFactory.getInstance().createDocument(StringUtil.repeat(LOREM_IPSUM + '\n', 15000)); - PlatformTestUtil.startPerformanceTest("Editor creation", 130, () -> { + PlatformTestUtil.startPerformanceTest("Editor creation", () -> { Editor editor = EditorFactory.getInstance().createEditor(document); try { LOG.debug(String.valueOf(editor.getContentComponent().getPreferredSize())); @@ -42,7 +42,7 @@ public class EditorCreationPerformanceTest extends AbstractEditorTest { public void testOpeningEditorWithLongLine() { Document document = EditorFactory.getInstance().createDocument(StringUtil.repeat(LOREM_IPSUM, 30000)); - PlatformTestUtil.startPerformanceTest("Editor creation", 2000, () -> { + PlatformTestUtil.startPerformanceTest("Editor creation", () -> { Editor editor = EditorFactory.getInstance().createEditor(document); try { EditorTestUtil.setEditorVisibleSize(editor, 100, 100); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorMultiCaretPerformanceTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorMultiCaretPerformanceTest.java index dba7589fe8f9..53f3190abc37 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorMultiCaretPerformanceTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorMultiCaretPerformanceTest.java @@ -26,7 +26,7 @@ public class EditorMultiCaretPerformanceTest extends AbstractEditorTest { int charactersToType = 100; String initialText = StringUtil.repeat("\n", caretCount); initText(initialText); - PlatformTestUtil.startPerformanceTest("Typing with large number of carets", 100_000, () -> { + PlatformTestUtil.startPerformanceTest("Typing with large number of carets", () -> { for (int i = 0; i < charactersToType; i++) { type('a'); } @@ -44,7 +44,7 @@ public class EditorMultiCaretPerformanceTest extends AbstractEditorTest { addFoldRegion(getEditor().getDocument().getLineStartOffset(i), getEditor().getDocument().getLineEndOffset(i), "..."); } }); - PlatformTestUtil.startPerformanceTest("Typing with large number of carets with a lot of fold regions", 150_000, () -> { + PlatformTestUtil.startPerformanceTest("Typing with large number of carets with a lot of fold regions", () -> { for (int i = 0; i < charactersToType; i++) { type('a'); } @@ -57,7 +57,7 @@ public class EditorMultiCaretPerformanceTest extends AbstractEditorTest { int charactersToType = 100; String initialText = "\n" + StringUtil.repeat(" \n", caretCount) + ""; init(initialText, StdFileTypes.XML); - PlatformTestUtil.startPerformanceTest("Typing in XML with large number of carets", 100_000, () -> { + PlatformTestUtil.startPerformanceTest("Typing in XML with large number of carets", () -> { for (int i = 0; i < charactersToType; i++) { type('a'); } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorPaintingPerformanceTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorPaintingPerformanceTest.java index f3954e38c006..8cb8f1244beb 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorPaintingPerformanceTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorPaintingPerformanceTest.java @@ -29,7 +29,7 @@ public class EditorPaintingPerformanceTest extends AbstractEditorTest { public void testScrollingThroughLongTextFile() { initText(StringUtil.repeat(LOREM_IPSUM + '\n', 15000)); - doTestScrollingPerformance("scrolling through text file with many lines", 2600); + doTestScrollingPerformance("scrolling through text file with many lines"); // attempt.min.ms varies ~5% (from experiments) } @@ -37,15 +37,15 @@ public class EditorPaintingPerformanceTest extends AbstractEditorTest { initText(StringUtil.repeat(LOREM_IPSUM + ' ', 15000)); EditorTestUtil.configureSoftWraps(getEditor(), EDITOR_WIDTH_PX, TEST_CHAR_WIDTH); - doTestScrollingPerformance("scrolling through long soft wrapped line", 2500); + doTestScrollingPerformance("scrolling through long soft wrapped line"); // attempt.min.ms varies ~4% (from experiments) } - private void doTestScrollingPerformance(String message, int expectedMs) { + private void doTestScrollingPerformance(String message) { EditorImpl editor = (EditorImpl)getEditor(); int editorHeight = editor.getPreferredHeight(); int[] result = {0}; - PlatformTestUtil.startPerformanceTest(message, expectedMs, () -> { + PlatformTestUtil.startPerformanceTest(message, () -> { for (int y = 0; y < editorHeight; y += 1000) { Rectangle clip = new Rectangle(0, y, EDITOR_WIDTH_PX, 1000); NullGraphics2D g = new NullGraphics2D(clip); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorPerformanceTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorPerformanceTest.java index f9632dc275c4..8d6882e60944 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorPerformanceTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorPerformanceTest.java @@ -19,7 +19,7 @@ public class EditorPerformanceTest extends AbstractEditorTest { getEditor().getMarkupModel().addRangeHighlighter(offset, offset + 1, 0, attributes, HighlighterTargetArea.EXACT_RANGE); } getEditor().getCaretModel().moveToOffset(0); - PlatformTestUtil.startPerformanceTest("Editing with a lot of highlighters", 5000, () -> { + PlatformTestUtil.startPerformanceTest("Editing with a lot of highlighters", () -> { for (int i = 0; i < 50; i++) { executeAction(IdeActions.ACTION_EDITOR_ENTER); UIUtil.dispatchAllInvocationEvents(); // let gutter update its width diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/FoldingStressTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/FoldingStressTest.java index e7564b9a8675..f7ed7fcce1b4 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/FoldingStressTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/FoldingStressTest.java @@ -87,7 +87,7 @@ public class FoldingStressTest extends LightPlatformTestCase { Editor editor = EditorFactory.getInstance().createEditor(doc); try { FoldingModelEx model = (FoldingModelEx)editor.getFoldingModel(); - PlatformTestUtil.startPerformanceTest("restoring many fold regions", 1500, () -> model.runBatchFoldingOperation(() -> { + PlatformTestUtil.startPerformanceTest("restoring many fold regions", () -> model.runBatchFoldingOperation(() -> { for (int i = 0; i < N; i++) { addAndCollapseFoldRegion(model, i, i+1, "/*...*/"); } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/LineSetIncrementalUpdateTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/LineSetIncrementalUpdateTest.java index cad3d2567249..ac76030d94b2 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/LineSetIncrementalUpdateTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/LineSetIncrementalUpdateTest.java @@ -53,7 +53,7 @@ public class LineSetIncrementalUpdateTest extends UsefulTestCase { public void testTypingInLongLinePerformance() { String longLine = StringUtil.repeat("a ", 200000); - PlatformTestUtil.startPerformanceTest("Document changes in a long line", 1000, () -> { + PlatformTestUtil.startPerformanceTest("Document changes in a long line", () -> { Document document = new DocumentImpl("a\n" + longLine + "" + longLine + "\n", true); for (int i = 0; i < 1000; i++) { int offset = i * 2 + longLine.length(); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/RangeMarkerTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/RangeMarkerTest.java index 7605aefa3a00..4505ddfdc6bd 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/RangeMarkerTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/RangeMarkerTest.java @@ -1118,7 +1118,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { } markupModel.addRangeHighlighter(null, N / 2, N / 2 + 1, 0, HighlighterTargetArea.LINES_IN_RANGE); - PlatformTestUtil.startPerformanceTest("highlighters lookup", (int)(N*Math.log(N)/1000), () -> { + PlatformTestUtil.startPerformanceTest("highlighters lookup", () -> { List list = new ArrayList<>(); CommonProcessors.CollectProcessor coll = new CommonProcessors.CollectProcessor<>(list); for (int i=0; i{ + PlatformTestUtil.startPerformanceTest("RM.getStartOffset", ()->{ insertString(doc, 0, " "); for (int i=0; i<1000; i++) { for (RangeMarker rm : markers) { @@ -1347,7 +1347,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { RangeMarker marker = doc.createRangeMarker(start, end); markers.add(marker); } - PlatformTestUtil.startPerformanceTest("RM.getStartOffset", 20000, ()->{ + PlatformTestUtil.startPerformanceTest("RM.getStartOffset", ()->{ insertString(doc, 0, " "); for (int i=0; i<1000; i++) { for (int j = 0; j < markers.size(); j++) { @@ -1372,7 +1372,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { RangeMarker marker = doc.createRangeMarker(start, end); markers.add(marker); } - PlatformTestUtil.startPerformanceTest("insert/delete string", 2000, ()->{ + PlatformTestUtil.startPerformanceTest("insert/delete string", ()->{ for (int i=0; i<15000; i++) { insertString(doc, 0, " "); deleteString(doc, 0, 1); @@ -1387,7 +1387,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { DocumentEx doc = new DocumentImpl(StringUtil.repeat("blah", 1000)); int N = 100_000; List markers = new ArrayList<>(N); - PlatformTestUtil.startPerformanceTest("createRM", 2000, ()->{ + PlatformTestUtil.startPerformanceTest("createRM", ()->{ for (int i = 0; i < N; i++) { int start = i % doc.getTextLength(); int end = start + 1; @@ -1410,7 +1410,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { RangeMarker marker = doc.createRangeMarker(start, end); markers.add(marker); } - PlatformTestUtil.startPerformanceTest(getTestName(false), 7_000, ()->{ + PlatformTestUtil.startPerformanceTest(getTestName(false), ()->{ for (int it = 0; it < 2_000; it++) { for (int i = 1; i < doc.getTextLength() - 1; i++) { boolean result = doc.processRangeMarkersOverlappingWith(i, i + 1, __ -> false); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/progress/impl/ProgressIndicatorTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/progress/impl/ProgressIndicatorTest.java index 3ef33927d8ff..74547afb1f5b 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/progress/impl/ProgressIndicatorTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/progress/impl/ProgressIndicatorTest.java @@ -340,7 +340,7 @@ public class ProgressIndicatorTest extends LightPlatformTestCase { } public void testProgressPerformance() { - PlatformTestUtil.startPerformanceTest("executeProcessUnderProgress", 400, () -> { + PlatformTestUtil.startPerformanceTest("executeProcessUnderProgress", () -> { EmptyProgressIndicator indicator = new EmptyProgressIndicator(); for (int i=0;i<100000;i++) { ProgressManager.getInstance().executeProcessUnderProgress(EmptyRunnable.getInstance(), indicator); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/roots/impl/IteratingContentUnderExcludedTest.kt b/platform/platform-tests/testSrc/com/intellij/openapi/roots/impl/IteratingContentUnderExcludedTest.kt index 7298f3074dff..6cf04b253fca 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/roots/impl/IteratingContentUnderExcludedTest.kt +++ b/platform/platform-tests/testSrc/com/intellij/openapi/roots/impl/IteratingContentUnderExcludedTest.kt @@ -175,7 +175,7 @@ class IteratingContentUnderExcludedTest { IoTestUtil.assumeSymLinkCreationIsSupported() val root = projectModel.baseProjectDir.virtualFileRoot generateSymlinkExplosion(VfsUtilCore.virtualToIoFile(root), 17) - PlatformTestUtil.startPerformanceTest("traversing non-project roots", 100) { checkIterate(root) }.assertTiming() + PlatformTestUtil.startPerformanceTest("traversing non-project roots") { checkIterate(root) }.assertTiming() } companion object { diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/roots/impl/ProjectFileIndexPerformanceTest.kt b/platform/platform-tests/testSrc/com/intellij/openapi/roots/impl/ProjectFileIndexPerformanceTest.kt index 7c22fbe0a24b..0cd8ffea0d0f 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/roots/impl/ProjectFileIndexPerformanceTest.kt +++ b/platform/platform-tests/testSrc/com/intellij/openapi/roots/impl/ProjectFileIndexPerformanceTest.kt @@ -135,7 +135,7 @@ class ProjectFileIndexPerformanceTest { } val filesWithoutId = arrayOf(noId1, noId2, noId3) val fsRoot = VirtualFileManager.getInstance().findFileByUrl("temp:///")!! - PlatformTestUtil.startPerformanceTest("Checking status of source files in ProjectFileIndex", 2500) { + PlatformTestUtil.startPerformanceTest("Checking status of source files in ProjectFileIndex") { runReadAction { repeat(100) { assertFalse(fileIndex.isInContent(fsRoot)) @@ -157,7 +157,7 @@ class ProjectFileIndexPerformanceTest { @Test fun `access to excluded files`() { - PlatformTestUtil.startPerformanceTest("Checking status of excluded files in ProjectFileIndex", 250) { + PlatformTestUtil.startPerformanceTest("Checking status of excluded files in ProjectFileIndex") { runReadAction { repeat(10) { for (file in ourExcludedFilesToTest) { @@ -172,7 +172,7 @@ class ProjectFileIndexPerformanceTest { @Test fun `access to library files`() { - PlatformTestUtil.startPerformanceTest("Checking status of library files in ProjectFileIndex", 600) { + PlatformTestUtil.startPerformanceTest("Checking status of library files in ProjectFileIndex") { runReadAction { repeat(10) { for (file in ourLibraryFilesToTest) { @@ -193,7 +193,7 @@ class ProjectFileIndexPerformanceTest { @Test fun `access to library source files`() { - PlatformTestUtil.startPerformanceTest("Checking status of library source files in ProjectFileIndex", 600) { + PlatformTestUtil.startPerformanceTest("Checking status of library source files in ProjectFileIndex") { runReadAction { repeat(10) { for (file in ourLibrarySourceFilesToTest) { @@ -216,7 +216,7 @@ class ProjectFileIndexPerformanceTest { fun `access to index after change`() { val newRoot = runWriteActionAndWait { ourProjectRoot.subdir("newContentRoot") } val module = ourProjectModel.moduleManager.findModuleByName("big")!! - PlatformTestUtil.startPerformanceTest("Checking status of file after adding and removing content root", 5) { + PlatformTestUtil.startPerformanceTest("Checking status of file after adding and removing content root") { runReadAction { repeat(50) { assertFalse(fileIndex.isInContent(newRoot)) diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/util/io/FileUtilPerformanceTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/util/io/FileUtilPerformanceTest.java index 5be4bb8681cb..cd109d949020 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/util/io/FileUtilPerformanceTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/util/io/FileUtilPerformanceTest.java @@ -16,7 +16,7 @@ public class FileUtilPerformanceTest { public void toCanonicalPath() { assertEquals(myCanonicalPath, FileUtil.toCanonicalPath(myTestPath)); - PlatformTestUtil.startPerformanceTest("toCanonicalPath", 1_200, () -> { + PlatformTestUtil.startPerformanceTest("toCanonicalPath", () -> { for (int i = 0; i < 1000000; ++i) { final String canonicalPath = FileUtil.toCanonicalPath(myTestPath, '/'); assert canonicalPath.length() == 18 : canonicalPath; @@ -28,7 +28,7 @@ public class FileUtilPerformanceTest { public void toCanonicalPathSimple() { assertEquals(mySimpleTestPath, FileUtil.toCanonicalPath(mySimpleTestPath)); - PlatformTestUtil.startPerformanceTest("toCanonicalPathSimple", 210, () -> { + PlatformTestUtil.startPerformanceTest("toCanonicalPathSimple", () -> { for (int i = 0; i < 1000000; ++i) { final String canonicalPath = FileUtil.toCanonicalPath(mySimpleTestPath, '/'); assert canonicalPath.length() == 8 : canonicalPath; @@ -40,7 +40,7 @@ public class FileUtilPerformanceTest { public void isAncestor() { assertTrue(FileUtil.isAncestor(myTestPath, myCanonicalPath, false)); - PlatformTestUtil.startPerformanceTest("isAncestor", 3000, () -> { + PlatformTestUtil.startPerformanceTest("isAncestor", () -> { for (int i = 0; i < 1000000; ++i) { assert FileUtil.isAncestor(myTestPath, myCanonicalPath, false); assert !FileUtil.isAncestor(myTestPath, myCanonicalPath, true); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/util/text/StringUtilPerformanceTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/util/text/StringUtilPerformanceTest.java index 82333e459ee5..c7791bdc540d 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/util/text/StringUtilPerformanceTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/util/text/StringUtilPerformanceTest.java @@ -29,7 +29,7 @@ public class StringUtilPerformanceTest { public void containsAnyChar() { assertTrue(StringUtil.containsAnyChar(TEST_STRING, Integer.toString(new Random().nextInt()))); - PlatformTestUtil.startPerformanceTest("StringUtil.containsAnyChar()", 600, () -> { + PlatformTestUtil.startPerformanceTest("StringUtil.containsAnyChar()", () -> { for (int i = 0; i < 1_000_000; i++) { if (StringUtil.containsAnyChar(TEST_STRING, "XYZ")) { throw new AssertionError(); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/ArchiveFileSystemPerformanceTest.kt b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/ArchiveFileSystemPerformanceTest.kt index 8dbab04d59be..f8fe6f782a99 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/ArchiveFileSystemPerformanceTest.kt +++ b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/ArchiveFileSystemPerformanceTest.kt @@ -20,7 +20,7 @@ class ArchiveFileSystemPerformanceTest : BareTestFixtureTestCase() { @Test fun getRootByEntry() { val root = fs.getRootByEntry(entry)!! - PlatformTestUtil.startPerformanceTest("ArchiveFileSystem.getRootByEntry()", 100) { + PlatformTestUtil.startPerformanceTest("ArchiveFileSystem.getRootByEntry()") { for (i in 0..100000) { assertEquals(root, fs.getRootByEntry(entry)) } @@ -29,7 +29,7 @@ class ArchiveFileSystemPerformanceTest : BareTestFixtureTestCase() { @Test fun getLocalByEntry() { val local = fs.getLocalByEntry(entry)!! - PlatformTestUtil.startPerformanceTest("ArchiveFileSystem.getLocalByEntry()", 40) { + PlatformTestUtil.startPerformanceTest("ArchiveFileSystem.getLocalByEntry()") { for (i in 0..100000) { assertEquals(local, fs.getLocalByEntry(entry)) } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/VfsUtilPerformanceTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/VfsUtilPerformanceTest.java index 49255325d4e4..c099ac301d2c 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/VfsUtilPerformanceTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/VfsUtilPerformanceTest.java @@ -81,7 +81,7 @@ public class VfsUtilPerformanceTest extends BareTestFixtureTestCase { UIUtil.pump(); // wait for all event handlers to calm down Logger.getInstance(VfsUtilPerformanceTest.class).debug("Start searching..."); - PlatformTestUtil.startPerformanceTest("finding child", 1500, () -> { + PlatformTestUtil.startPerformanceTest("finding child", () -> { for (int i = 0; i < 1_000_000; i++) { VirtualFile child = vDir.findChild("5111.txt"); assertEquals(theChild, child); @@ -105,7 +105,7 @@ public class VfsUtilPerformanceTest extends BareTestFixtureTestCase { String path = jar.getPath() + "!/"; ManagingFS managingFS = ManagingFS.getInstance(); NewVirtualFile root = managingFS.findRoot(path, fs); - PlatformTestUtil.startPerformanceTest("finding root", 20_000, + PlatformTestUtil.startPerformanceTest("finding root", () -> JobLauncher.getInstance().invokeConcurrentlyUnderProgress( Collections.nCopies(500, null), null, __ -> { @@ -115,7 +115,7 @@ public class VfsUtilPerformanceTest extends BareTestFixtureTestCase { assertSame(root, rootJar); } return true; - })).usesAllCPUCores().assertTiming(); + })).assertTiming(); } @Test @@ -123,7 +123,6 @@ public class VfsUtilPerformanceTest extends BareTestFixtureTestCase { VirtualFile root = tempDir.getVirtualFileRoot(); int depth = 10; int N = 5_000_000; - int time = 1000; WriteCommandAction.writeCommandAction(null).run(() -> { VirtualFile dir = root; @@ -151,7 +150,7 @@ public class VfsUtilPerformanceTest extends BareTestFixtureTestCase { } }; - PlatformTestUtil.startPerformanceTest("getParent before movement", time, checkPerformance) + PlatformTestUtil.startPerformanceTest("getParent before movement", checkPerformance) .assertTiming(getQualifiedTestMethodName() + " - getParent before movement"); VirtualFile dir1 = root.createChildDirectory(this, "dir1"); @@ -160,7 +159,7 @@ public class VfsUtilPerformanceTest extends BareTestFixtureTestCase { dir1.createChildData(this, "a" + i + ".txt").move(this, dir2); } - PlatformTestUtil.startPerformanceTest("getParent after movement", time, checkPerformance) + PlatformTestUtil.startPerformanceTest("getParent after movement", checkPerformance) .assertTiming(getQualifiedTestMethodName() + " - getParent after movement"); }); } @@ -185,7 +184,7 @@ public class VfsUtilPerformanceTest extends BareTestFixtureTestCase { "fff.txt"; VirtualFile file = fixture.findOrCreateDir(path); - PlatformTestUtil.startPerformanceTest("VF.getPath()", 10_000, () -> { + PlatformTestUtil.startPerformanceTest("VF.getPath()", () -> { for (int i = 0; i < 1_000_000; ++i) { file.getPath(); } @@ -270,7 +269,7 @@ public class VfsUtilPerformanceTest extends BareTestFixtureTestCase { VirtualDirectoryImpl temp = createTempFsDirectory(); EdtTestUtil.runInEdtAndWait(() -> { - PlatformTestUtil.startPerformanceTest("many files creations", 3_000, () -> { + PlatformTestUtil.startPerformanceTest("many files creations", () -> { assertEquals(N, events.size()); processEvents(events); assertEquals(N, temp.getCachedChildren().size()); @@ -285,7 +284,7 @@ public class VfsUtilPerformanceTest extends BareTestFixtureTestCase { }) .assertTiming(getQualifiedTestMethodName() + " - many files creations"); - PlatformTestUtil.startPerformanceTest("many files deletions", 3_300, () -> { + PlatformTestUtil.startPerformanceTest("many files deletions", () -> { assertEquals(N, events.size()); processEvents(events); assertEquals(0, temp.getCachedChildren().size()); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/encoding/FileEncodingTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/encoding/FileEncodingTest.java index 797eeffa7ef0..8ae4d65befb0 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/encoding/FileEncodingTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/encoding/FileEncodingTest.java @@ -1021,7 +1021,7 @@ public class FileEncodingTest extends HeavyPlatformTestCase implements TestDialo WriteCommandAction.runWriteCommandAction(myProject, () -> document.insertString(0, " ")); EncodingManagerImpl encodingManager = (EncodingManagerImpl)EncodingManager.getInstance(); encodingManager.waitAllTasksExecuted(60, TimeUnit.SECONDS); - PlatformTestUtil.startPerformanceTest("encoding re-detect requests", 10_000, ()->{ + PlatformTestUtil.startPerformanceTest("encoding re-detect requests", ()->{ for (int i=0; i<100_000_000;i++) { encodingManager.queueUpdateEncodingFromContent(document); } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/impl/VirtualFilePointerRootsTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/impl/VirtualFilePointerRootsTest.java index e07a2422aebe..d8e65e4a9f63 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/impl/VirtualFilePointerRootsTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/impl/VirtualFilePointerRootsTest.java @@ -71,7 +71,7 @@ public class VirtualFilePointerRootsTest extends HeavyPlatformTestCase { } public void testContainerCreateDeletePerformance() { - PlatformTestUtil.startPerformanceTest(getTestName(false), 1000, () -> { + PlatformTestUtil.startPerformanceTest(getTestName(false), () -> { Disposable parent = Disposer.newDisposable(); for (int i = 0; i < 100_000; i++) { myVirtualFilePointerManager.createContainer(parent); @@ -86,7 +86,7 @@ public class VirtualFilePointerRootsTest extends HeavyPlatformTestCase { String url = VfsUtilCore.pathToUrl(f.getPath()); VirtualFilePointer thePointer = myVirtualFilePointerManager.create(url, disposable, listener); assertNotNull(TempFileSystem.getInstance()); - PlatformTestUtil.startPerformanceTest(getTestName(false), 9000, () -> { + PlatformTestUtil.startPerformanceTest(getTestName(false), () -> { for (int i = 0; i < 1_000_000; i++) { VirtualFilePointer pointer = myVirtualFilePointerManager.create(url, disposable, listener); assertSame(pointer, thePointer); @@ -101,7 +101,7 @@ public class VirtualFilePointerRootsTest extends HeavyPlatformTestCase { VirtualFile v = refreshAndFindFile(f); VirtualFilePointer thePointer = myVirtualFilePointerManager.create(v, disposable, listener); assertNotNull(TempFileSystem.getInstance()); - PlatformTestUtil.startPerformanceTest(getTestName(false), 10000, () -> { + PlatformTestUtil.startPerformanceTest(getTestName(false), () -> { for (int i = 0; i < 10_000_000; i++) { VirtualFilePointer pointer = myVirtualFilePointerManager.create(v, disposable, listener); assertSame(pointer, thePointer); @@ -120,7 +120,7 @@ public class VirtualFilePointerRootsTest extends HeavyPlatformTestCase { String name = "xxx" + (i%20); events.add(new VFileCreateEvent(this, temp, name, true, null, null, null)); } - PlatformTestUtil.startPerformanceTest(getTestName(false), 4_000, () -> { + PlatformTestUtil.startPerformanceTest(getTestName(false), () -> { for (int i = 0; i < 100; i++) { // simulate VFS refresh events since launching the actual refresh is too slow AsyncFileListener.ChangeApplier applier = myVirtualFilePointerManager.prepareChange(events); @@ -149,7 +149,7 @@ public class VirtualFilePointerRootsTest extends HeavyPlatformTestCase { PersistentFSImpl persistentFS = (PersistentFSImpl)ManagingFS.getInstance(); - PlatformTestUtil.startPerformanceTest(getTestName(false), 7000, () -> { + PlatformTestUtil.startPerformanceTest(getTestName(false), () -> { for (int i=0; i<500_000; i++) { persistentFS.incStructuralModificationCount(); AsyncFileListener.ChangeApplier applier = myVirtualFilePointerManager.prepareChange(createEvents); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/impl/VirtualFilePointerTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/impl/VirtualFilePointerTest.java index c5dcee9ff0a7..7d21ea605465 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/impl/VirtualFilePointerTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/impl/VirtualFilePointerTest.java @@ -1124,7 +1124,7 @@ public class VirtualFilePointerTest extends BareTestFixtureTestCase { assertNotNull(pointer.getFile()); assertTrue(pointer.getFile().isValid()); - PlatformTestUtil.startPerformanceTest("get()", 3000, () -> { + PlatformTestUtil.startPerformanceTest("get()", () -> { for (int i=0; i<200_000_000; i++) { assertNotNull(pointer.getFile()); } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/impl/local/WatchRootsManagerPerformanceTest.kt b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/impl/local/WatchRootsManagerPerformanceTest.kt index 09e33c988e8c..29f0ad5f69ab 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/impl/local/WatchRootsManagerPerformanceTest.kt +++ b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/impl/local/WatchRootsManagerPerformanceTest.kt @@ -78,7 +78,7 @@ class WatchRootsManagerPerformanceTest : BareTestFixtureTestCase() { try { val roots = (1..fileCount).map { "${root}/f${it}" } val requests = ArrayList(fileCount) - PlatformTestUtil.startPerformanceTest("Adding roots", 9000) { + PlatformTestUtil.startPerformanceTest("Adding roots") { roots.forEach { requests.add(fs.addRootToWatch(it, true)!!) } @@ -97,7 +97,7 @@ class WatchRootsManagerPerformanceTest : BareTestFixtureTestCase() { try { val roots = (1..fileCount).map { "${root}/f${it}" } - PlatformTestUtil.startPerformanceTest("Adding roots", 13000) { + PlatformTestUtil.startPerformanceTest("Adding roots") { fs.removeWatchedRoots(fs.addRootsToWatch(roots, true)) }.assertTiming() } @@ -115,7 +115,7 @@ class WatchRootsManagerPerformanceTest : BareTestFixtureTestCase() { try { val rootPath = root.toString() - PlatformTestUtil.startPerformanceTest("Adding roots", 2000) { + PlatformTestUtil.startPerformanceTest("Adding roots") { fs.removeWatchedRoot(fs.addRootToWatch(rootPath, true)!!) }.assertTiming() } @@ -138,13 +138,13 @@ class WatchRootsManagerPerformanceTest : BareTestFixtureTestCase() { (1..5).forEach { pathMappings.add(Pair("$root/rec$i/ln$it", "$root/targets/rec$i/ln$it")) } } - PlatformTestUtil.startPerformanceTest("Create canonical path map", 7000) { + PlatformTestUtil.startPerformanceTest("Create canonical path map") { repeat(18) { WatchRootsManager.createCanonicalPathMap(flatWatchRoots, optimizedRecursiveWatchRoots, pathMappings, false) } }.assertTimingAsSubtest() - PlatformTestUtil.startPerformanceTest("Create canonical path map - convert paths", 10000) { + PlatformTestUtil.startPerformanceTest("Create canonical path map - convert paths") { repeat(18) { WatchRootsManager.createCanonicalPathMap(flatWatchRoots, optimizedRecursiveWatchRoots, pathMappings, true) } @@ -167,19 +167,19 @@ class WatchRootsManagerPerformanceTest : BareTestFixtureTestCase() { val map = WatchRootsManager.createCanonicalPathMap(flatWatchRoots, optimizedRecursiveWatchRoots, pathMappings, false) map.addMapping((1..filesCount).map { Pair("$root/src/ln$it-3", "$root/src/ln$it-3") }) - PlatformTestUtil.startPerformanceTest("Test apply mapping from canonical path map", 3000) { + PlatformTestUtil.startPerformanceTest("Test apply mapping from canonical path map") { repeat(1_000_000) { map.mapToOriginalWatchRoots("$root/src/ln${(Math.random() * 200_000).toInt()}", true) } }.assertTimingAsSubtest() - PlatformTestUtil.startPerformanceTest("Create canonical path map", 3000) { + PlatformTestUtil.startPerformanceTest("Create canonical path map") { repeat(100) { WatchRootsManager.createCanonicalPathMap(flatWatchRoots, optimizedRecursiveWatchRoots, pathMappings, false) } }.assertTimingAsSubtest() - PlatformTestUtil.startPerformanceTest("Create canonical path map - convert paths", 3000) { + PlatformTestUtil.startPerformanceTest("Create canonical path map - convert paths") { repeat(40) { WatchRootsManager.createCanonicalPathMap(flatWatchRoots, optimizedRecursiveWatchRoots, pathMappings, true) } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/LocalFileSystemTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/LocalFileSystemTest.java index 262c628d2b3c..a63ef2230185 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/LocalFileSystemTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/LocalFileSystemTest.java @@ -899,7 +899,7 @@ public class LocalFileSystemTest extends BareTestFixtureTestCase { @Test public void testFindFileByUrlPerformance() { VirtualFileManager virtualFileManager = VirtualFileManager.getInstance(); - PlatformTestUtil.startPerformanceTest("findFileByUrl", 2000, () -> { + PlatformTestUtil.startPerformanceTest("findFileByUrl", () -> { for (int i=0; i<10_000_000;i++) { assertNull(virtualFileManager.findFileByUrl("temp://")); } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/newvfs/impl/LocalFileSystemStressTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/newvfs/impl/LocalFileSystemStressTest.java index 1496bafc5e62..ddfda1b86826 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/newvfs/impl/LocalFileSystemStressTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/newvfs/impl/LocalFileSystemStressTest.java @@ -32,7 +32,7 @@ public class LocalFileSystemStressTest extends BareTestFixtureTestCase { assertThat(tmpRoot.getFileSystem()).isInstanceOf(TempFileSystem.class); VirtualFile testDir = WriteAction.computeAndWait(() -> tmpRoot.createChildDirectory(this, getTestName(true))); int N_LEVELS = 1_000_000; - PlatformTestUtil.startPerformanceTest(getTestName(false), 3_000, () -> { + PlatformTestUtil.startPerformanceTest(getTestName(false), () -> { UIUtil.pump(); StringBuilder expectedPath = new StringBuilder(N_LEVELS*4+100); expectedPath.append(testDir.getPath()); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/newvfs/persistent/VFSInitializationBenchmarkTest.kt b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/newvfs/persistent/VFSInitializationBenchmarkTest.kt index b2eb7a6b74b5..3b4f2f04d379 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/newvfs/persistent/VFSInitializationBenchmarkTest.kt +++ b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/newvfs/persistent/VFSInitializationBenchmarkTest.kt @@ -14,9 +14,7 @@ class VFSInitializationBenchmarkTest { @Test @Throws(Exception::class) fun benchmarkVfsInitializationTime_CreateVfsFromScratch(@TempDir temporaryDirectory: Path) { - PlatformTestUtil.startPerformanceTest( - "create VFS from scratch", 1000 - ) { + PlatformTestUtil.startPerformanceTest("create VFS from scratch") { val cachesDir: Path = temporaryDirectory val version = 1 @@ -26,7 +24,6 @@ class VFSInitializationBenchmarkTest { ) PersistentFSConnector.disconnect(initializationResult.connection) } - .ioBound() .warmupIterations(1) .attempts(4) .assertTiming() @@ -43,9 +40,7 @@ class VFSInitializationBenchmarkTest { ) PersistentFSConnector.disconnect(result.connection) - PlatformTestUtil.startPerformanceTest( - "open existing VFS files", 500 - ) { + PlatformTestUtil.startPerformanceTest("open existing VFS files") { val initResult = PersistentFSConnector.connectWithoutVfsLog( cachesDir, version @@ -53,7 +48,6 @@ class VFSInitializationBenchmarkTest { Assertions.assertFalse(initResult.vfsCreatedAnew, "Must open existing") PersistentFSConnector.disconnect(initResult.connection) } - .ioBound() //.warmupIterations(1) .attempts(4) .assertTiming() } diff --git a/platform/platform-tests/testSrc/com/intellij/psi/impl/search/LowLevelSearchUtilTest.java b/platform/platform-tests/testSrc/com/intellij/psi/impl/search/LowLevelSearchUtilTest.java index 5af0b5c42c89..ad0ce9a512f0 100644 --- a/platform/platform-tests/testSrc/com/intellij/psi/impl/search/LowLevelSearchUtilTest.java +++ b/platform/platform-tests/testSrc/com/intellij/psi/impl/search/LowLevelSearchUtilTest.java @@ -44,7 +44,7 @@ public class LowLevelSearchUtilTest extends TestCase { IntList found = new IntArrayList(new int[]{-1}); CharSequence text = StringUtil.repeat("xxx z ", 1000000); - PlatformTestUtil.startPerformanceTest("processTextOccurrences", 100, ()-> { + PlatformTestUtil.startPerformanceTest("processTextOccurrences", ()-> { for (int i=0; i<10000; i++) { found.removeInt(0); int startOffset = text.length() / 2 + i % 20; diff --git a/platform/platform-tests/testSrc/com/intellij/psi/tree/TokenSetTest.java b/platform/platform-tests/testSrc/com/intellij/psi/tree/TokenSetTest.java index 342836bca1f8..6f6b2afc919f 100644 --- a/platform/platform-tests/testSrc/com/intellij/psi/tree/TokenSetTest.java +++ b/platform/platform-tests/testSrc/com/intellij/psi/tree/TokenSetTest.java @@ -116,11 +116,11 @@ public class TokenSetTest { final TokenSet set = TokenSet.create(); final int shift = new Random().nextInt(500000); - PlatformTestUtil.startPerformanceTest("TokenSet.contains()", 25, () -> { + PlatformTestUtil.startPerformanceTest("TokenSet.contains()", () -> { for (int i = 0; i < 1000000; i++) { final IElementType next = elementTypes[(i + shift) % elementTypes.length]; assertFalse(set.contains(next)); } - }).useLegacyScaling().assertTiming(); + }).assertTiming(); } } diff --git a/platform/platform-tests/testSrc/com/intellij/psi/util/MinusculeMatcherPerformanceTest.java b/platform/platform-tests/testSrc/com/intellij/psi/util/MinusculeMatcherPerformanceTest.java index 576fbb632e15..28354ffedb0c 100644 --- a/platform/platform-tests/testSrc/com/intellij/psi/util/MinusculeMatcherPerformanceTest.java +++ b/platform/platform-tests/testSrc/com/intellij/psi/util/MinusculeMatcherPerformanceTest.java @@ -28,7 +28,7 @@ public class MinusculeMatcherPerformanceTest extends TestCase { nonMatching.add(NameUtil.buildMatcher(s, NameUtil.MatchingCaseSensitivity.NONE)); } - PlatformTestUtil.startPerformanceTest("Matching", 4_000, () -> { + PlatformTestUtil.startPerformanceTest("Matching", () -> { for (int i = 0; i < 100_000; i++) { for (MinusculeMatcher matcher : matching) { Assert.assertTrue(matcher.matches(longName)); @@ -42,7 +42,7 @@ public class MinusculeMatcherPerformanceTest extends TestCase { } public void testOnlyUnderscoresPerformance() { - PlatformTestUtil.startPerformanceTest(getName(), 120, () -> { + PlatformTestUtil.startPerformanceTest(getName(), () -> { String small = StringUtil.repeat("_", 50000); String big = StringUtil.repeat("_", small.length() + 1); assertMatches("*" + small, big); @@ -51,7 +51,7 @@ public class MinusculeMatcherPerformanceTest extends TestCase { } public void testRepeatedLetterPerformance() { - PlatformTestUtil.startPerformanceTest(getName(), 30, () -> { + PlatformTestUtil.startPerformanceTest(getName(), () -> { String big = StringUtil.repeat("Aaaaaa", 50000); assertMatches("aaaaaaaaaaaaaaaaaaaaaaaa", big); assertDoesntMatch("aaaaaaaaaaaaaaaaaaaaaaaab", big); @@ -59,7 +59,7 @@ public class MinusculeMatcherPerformanceTest extends TestCase { } public void testMatchingLongHtmlWithShortHtml() { - PlatformTestUtil.startPerformanceTest(getName(), 30, () -> { + PlatformTestUtil.startPerformanceTest(getName(), () -> { String pattern = "*

aaa

com.sshtools.cipher
Class AES128Cbc
 java.lang.Object   \"extendedcom.maverick.ssh.cipher.SshCipher       \"extendedcom.maverick.ssh.crypto.engines.CbcBlockCipher           \"extendedcom.sshtools.cipher.AES128Cbc 

public class AES128Cbc
extends com.maverick.ssh.crypto.engines.CbcBlockCipher

This cipher can optionally be added to the J2SSH Maverick API. To add the ciphers from this package simply add them to the Ssh2Context

   import com.sshtools.cipher.*;   

Version:
Revision: 1.20

"; @@ -82,11 +82,11 @@ public class MinusculeMatcherPerformanceTest extends TestCase { } private void assertDoesntMatchFast(String pattern, String name, String subTestName) { - PlatformTestUtil.startPerformanceTest(getName(), 30, () -> assertDoesntMatch(pattern, name)).assertTimingAsSubtest(subTestName); + PlatformTestUtil.startPerformanceTest(getName(), () -> assertDoesntMatch(pattern, name)).assertTimingAsSubtest(subTestName); } public void testMatchingLongRuby() { - PlatformTestUtil.startPerformanceTest(getName(), 30, () -> { + PlatformTestUtil.startPerformanceTest(getName(), () -> { String pattern = "*# -*- coding: utf-8 -*-$:. unshift(\"/Library/RubyMotion/lib\")require 'motion/project'Motion::Project::App. setup do |app| # Use `rake config' to see complete project settings. app. sdk_version = '4. 3'end"; String name = "# -*- coding: utf-8 -*-$:.unshift(\"/Library/RubyMotion/lib\")require 'motion/project'Motion::Project::App.setup do |app| # Use `rake config' to see complete project settings. app.sdk_version = '4.3' app.frameworks -= ['UIKit']end"; assertDoesntMatch(pattern, name); @@ -96,7 +96,7 @@ public class MinusculeMatcherPerformanceTest extends TestCase { public void testLongStringMatchingWithItself() { String s = "the class with its attributes mapped to fields of records parsed by an {@link AbstractParser} or written by an {@link AbstractWriter}."; - PlatformTestUtil.startPerformanceTest(getName(), 30, () -> { + PlatformTestUtil.startPerformanceTest(getName(), () -> { assertMatches(s, s); assertMatches("*" + s, s); diff --git a/platform/platform-tests/testSrc/com/intellij/serviceContainer/ConstructorInjectionTest.kt b/platform/platform-tests/testSrc/com/intellij/serviceContainer/ConstructorInjectionTest.kt index ac7fb15ee200..b0726b25148c 100644 --- a/platform/platform-tests/testSrc/com/intellij/serviceContainer/ConstructorInjectionTest.kt +++ b/platform/platform-tests/testSrc/com/intellij/serviceContainer/ConstructorInjectionTest.kt @@ -16,7 +16,7 @@ class ConstructorInjectionTest { fun `light service getService() performance`() { val componentManager = TestComponentManager() assertThat(componentManager.getService(BarService::class.java)).isNotNull() - PlatformTestUtil.startPerformanceTest("getService() must be fast for cached service", 1000) { + PlatformTestUtil.startPerformanceTest("getService() must be fast for cached service") { for (i in 0..30_000_000) { componentManager.getService(BarService::class.java)!! } diff --git a/platform/platform-tests/testSrc/com/intellij/ui/FileNameSplittingTest.java b/platform/platform-tests/testSrc/com/intellij/ui/FileNameSplittingTest.java index d01a53fcb594..c53d59dc4813 100644 --- a/platform/platform-tests/testSrc/com/intellij/ui/FileNameSplittingTest.java +++ b/platform/platform-tests/testSrc/com/intellij/ui/FileNameSplittingTest.java @@ -118,7 +118,7 @@ public class FileNameSplittingTest extends TestCase { public void testPerformance() { myPolicy = FilePathSplittingPolicy.SPLIT_BY_SEPARATOR; - PlatformTestUtil.startPerformanceTest("FileNameSplitting", 70, () -> { + PlatformTestUtil.startPerformanceTest("FileNameSplitting", () -> { for (int i = 0; i < 100; i++) { for (int j = 0; j < FILE.getPath().length(); j++) myPolicy.getPresentableName(FILE, j); diff --git a/platform/platform-tests/testSrc/com/intellij/util/containers/ConcurrentBitSetTest.java b/platform/platform-tests/testSrc/com/intellij/util/containers/ConcurrentBitSetTest.java index c73ad87d06a7..2c2ff4109604 100644 --- a/platform/platform-tests/testSrc/com/intellij/util/containers/ConcurrentBitSetTest.java +++ b/platform/platform-tests/testSrc/com/intellij/util/containers/ConcurrentBitSetTest.java @@ -92,7 +92,7 @@ class ConcurrentBitSetTest { PlatformTestUtil.assumeEnoughParallelism(); int L = 128; int N = 10_000; - PlatformTestUtil.startPerformanceTest("testStressFineGrainedSmallSetModifications", 22_000, () -> tortureParallelSetClear(L, N)).assertTiming(); + PlatformTestUtil.startPerformanceTest("testStressFineGrainedSmallSetModifications", () -> tortureParallelSetClear(L, N)).assertTiming(); } @Test @@ -102,7 +102,7 @@ class ConcurrentBitSetTest { // todo ARM64 is slow for some reason int N = CpuArch.isArm64() ? 300 : 1000; - PlatformTestUtil.startPerformanceTest("testStressCoarseGrainedBigSet", 100_000, () -> tortureParallelSetClear(L, N)).assertTiming(); + PlatformTestUtil.startPerformanceTest("testStressCoarseGrainedBigSet", () -> tortureParallelSetClear(L, N)).assertTiming(); } private static void tortureParallelSetClear(int L, int N) { @@ -196,7 +196,7 @@ class ConcurrentBitSetTest { int N = 100_000; ExecutorService executor = create4ThreadsExecutor(); - PlatformTestUtil.startPerformanceTest("testParallelReadPerformance", 35_000, ()-> { + PlatformTestUtil.startPerformanceTest("testParallelReadPerformance", ()-> { Semaphore threadReady = new Semaphore(); Set threadUsed = ConcurrentCollectionFactory.createConcurrentSet(); boundedParallelRun(executor, threadUsed, threadReady, N, __-> { @@ -207,7 +207,7 @@ class ConcurrentBitSetTest { assertEquals(expectedSum, r); }); // really must not depend on CPU core number - })/*.usesAllCPUCores()*/.assertTiming(); + })/**/.assertTiming(); } @Test diff --git a/platform/platform-tests/testSrc/com/intellij/util/containers/ContainerUtilTest.java b/platform/platform-tests/testSrc/com/intellij/util/containers/ContainerUtilTest.java index 63cf91aec1b4..64830f1ddf85 100644 --- a/platform/platform-tests/testSrc/com/intellij/util/containers/ContainerUtilTest.java +++ b/platform/platform-tests/testSrc/com/intellij/util/containers/ContainerUtilTest.java @@ -173,7 +173,7 @@ public class ContainerUtilTest extends TestCase { List list = ContainerUtil.createLockFreeCopyOnWriteList(); int count = 15000; List ints = IntStreamEx.range(0, count).boxed().toList(); - PlatformTestUtil.startPerformanceTest("COWList add", 4500, () -> { + PlatformTestUtil.startPerformanceTest("COWList add", () -> { for (int it = 0; it < 10; it++) { list.clear(); for (int i = 0; i < count; i++) { diff --git a/platform/platform-tests/testSrc/com/intellij/util/io/PersistentBTreeEnumeratorTest.java b/platform/platform-tests/testSrc/com/intellij/util/io/PersistentBTreeEnumeratorTest.java index b0686d0777b8..33e84cf4f985 100644 --- a/platform/platform-tests/testSrc/com/intellij/util/io/PersistentBTreeEnumeratorTest.java +++ b/platform/platform-tests/testSrc/com/intellij/util/io/PersistentBTreeEnumeratorTest.java @@ -225,7 +225,7 @@ public class PersistentBTreeEnumeratorTest { StorageLockContext.assertNoBuffersLocked(); FilePageCacheStatistics statsBefore = StorageLockContext.getStatistics(); - PlatformTestUtil.startPerformanceTest("PersistentStringEnumerator", 400, () -> { + PlatformTestUtil.startPerformanceTest("PersistentStringEnumerator", () -> { for (int i = 0; i < 10000; i++) { for (String item : data) { assertNotEquals(0, myEnumerator.tryEnumerate(item)); @@ -327,7 +327,7 @@ public class PersistentBTreeEnumeratorTest { } }; - PlatformTestUtil.startPerformanceTest("PersistentStringEnumerator", 1000, () -> { + PlatformTestUtil.startPerformanceTest("PersistentStringEnumerator", () -> { stringCache.addDeletedPairsListener(listener); for (int i = 0; i < 100000; ++i) { String string = createRandomString(); diff --git a/platform/platform-tests/testSrc/com/intellij/util/io/PersistentMapPerformanceTest.java b/platform/platform-tests/testSrc/com/intellij/util/io/PersistentMapPerformanceTest.java index a08c1726a0f5..f4c35f9b0e68 100644 --- a/platform/platform-tests/testSrc/com/intellij/util/io/PersistentMapPerformanceTest.java +++ b/platform/platform-tests/testSrc/com/intellij/util/io/PersistentMapPerformanceTest.java @@ -334,7 +334,7 @@ public class PersistentMapPerformanceTest extends PersistentMapTestBase { }; AtomicInteger count = new AtomicInteger(); - PlatformTestUtil.startPerformanceTest("put/remove", 9000, () -> { + PlatformTestUtil.startPerformanceTest("put/remove", () -> { try { stringCache.addDeletedPairsListener(listener); for (int i = 0; i < 100000; ++i) { @@ -354,7 +354,7 @@ public class PersistentMapPerformanceTest extends PersistentMapTestBase { catch (IOException e) { throw new RuntimeException(e); } - }).ioBound().assertTiming(); + }).assertTiming(); myMap.close(); LOG.debug(String.format("File size = %d bytes\n", myFile.length())); @@ -368,7 +368,7 @@ public class PersistentMapPerformanceTest extends PersistentMapTestBase { strings.add(createRandomString()); } - PlatformTestUtil.startPerformanceTest("put/remove", 1500, () -> { + PlatformTestUtil.startPerformanceTest("put/remove", () -> { for (int i = 0; i < 100000; ++i) { final String string = strings.get(i); myMap.put(string, string); diff --git a/platform/platform-tests/testSrc/com/intellij/util/io/StringEnumeratorTest.java b/platform/platform-tests/testSrc/com/intellij/util/io/StringEnumeratorTest.java index 069212801451..6ce1a09d107a 100644 --- a/platform/platform-tests/testSrc/com/intellij/util/io/StringEnumeratorTest.java +++ b/platform/platform-tests/testSrc/com/intellij/util/io/StringEnumeratorTest.java @@ -163,7 +163,7 @@ public class StringEnumeratorTest extends TestCase { } }; - PlatformTestUtil.startPerformanceTest("PersistentStringEnumerator.enumerate", 700, () -> { + PlatformTestUtil.startPerformanceTest("PersistentStringEnumerator.enumerate", () -> { stringCache.addDeletedPairsListener(listener); for (int i = 0; i < 100000; ++i) { final String string = createRandomString(); diff --git a/platform/platform-tests/testSrc/com/intellij/util/messages/impl/MessageBusTest.kt b/platform/platform-tests/testSrc/com/intellij/util/messages/impl/MessageBusTest.kt index 4e8f65b151fd..261b58da926f 100644 --- a/platform/platform-tests/testSrc/com/intellij/util/messages/impl/MessageBusTest.kt +++ b/platform/platform-tests/testSrc/com/intellij/util/messages/impl/MessageBusTest.kt @@ -243,7 +243,7 @@ class MessageBusTest : MessageBusOwner { @Test fun manyChildrenCreationDeletionPerformance() { - PlatformTestUtil.startPerformanceTest("Child bus creation/deletion", 1000) { + PlatformTestUtil.startPerformanceTest("Child bus creation/deletion") { val children = ArrayList() val count = 10000 for (i in 0 until count) { diff --git a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/OutputEventSplitterTest.java b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/OutputEventSplitterTest.java index 37dabb42b460..e3667bf047ef 100644 --- a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/OutputEventSplitterTest.java +++ b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/OutputEventSplitterTest.java @@ -369,13 +369,12 @@ public class OutputEventSplitterTest extends LightPlatformTestCase { } public void testPerformanceWithLotsOfFragments() { - PlatformTestUtil.startPerformanceTest("Flushing lot's of fragments", 10, mySplitter::flush) + PlatformTestUtil.startPerformanceTest("Flushing lot's of fragments", mySplitter::flush) .setup(() -> { for (int i = 0; i < 10_000; i++) { mySplitter.process("some string without slash n appending in raw, attempt: " + i + "; ", ProcessOutputTypes.STDOUT); } }) - .useLegacyScaling() .assertTiming(); } @@ -387,7 +386,7 @@ public class OutputEventSplitterTest extends LightPlatformTestCase { } }; - PlatformTestUtil.startPerformanceTest("print newlines with backspace", 5000, () -> { + PlatformTestUtil.startPerformanceTest("print newlines with backspace", () -> { for (int i = 0; i < 2_000_000; i++) { mySplitter.process("some string without slash n appending in raw, attempt: " + i + "; ", ProcessOutputTypes.STDOUT); mySplitter.process(testStarted, ProcessOutputTypes.STDOUT); diff --git a/platform/structuralsearch/testSource/com/intellij/structuralsearch/StructuralReplaceTest.java b/platform/structuralsearch/testSource/com/intellij/structuralsearch/StructuralReplaceTest.java index 253bce5ede44..27ec3769a4ef 100644 --- a/platform/structuralsearch/testSource/com/intellij/structuralsearch/StructuralReplaceTest.java +++ b/platform/structuralsearch/testSource/com/intellij/structuralsearch/StructuralReplaceTest.java @@ -2048,7 +2048,7 @@ public class StructuralReplaceTest extends StructuralReplaceTestCase { final String pattern = loadFile("ReformatAndShortenClassRefPerformance_pattern.java"); final String replacement = loadFile("ReformatAndShortenClassRefPerformance_replacement.java"); - PlatformTestUtil.startPerformanceTest("SSR Reformat", 20000, + PlatformTestUtil.startPerformanceTest("SSR Reformat", () -> assertEquals("Reformat Performance", loadFile("ReformatPerformance_result.java"), replace(source, pattern, replacement, true, true))) .assertTimingAsSubtest(); @@ -2056,7 +2056,7 @@ public class StructuralReplaceTest extends StructuralReplaceTestCase { options.setToReformatAccordingToStyle(false); options.setToShortenFQN(true); - PlatformTestUtil.startPerformanceTest("SSR Shorten Class Reference", 20000, + PlatformTestUtil.startPerformanceTest("SSR Shorten Class Reference", () -> assertEquals("Shorten Class Ref Performance", loadFile("ShortenPerformance_result.java"), replace(source, pattern, replacement, true, true))) .assertTimingAsSubtest(); diff --git a/platform/structuralsearch/testSource/com/intellij/structuralsearch/inspection/SSBasedInspectionTest.java b/platform/structuralsearch/testSource/com/intellij/structuralsearch/inspection/SSBasedInspectionTest.java index 4438ac7d9a4b..bf5df23db8d9 100644 --- a/platform/structuralsearch/testSource/com/intellij/structuralsearch/inspection/SSBasedInspectionTest.java +++ b/platform/structuralsearch/testSource/com/intellij/structuralsearch/inspection/SSBasedInspectionTest.java @@ -82,7 +82,7 @@ public class SSBasedInspectionTest extends SSBasedInspectionTestCase { final ToolsImpl tools = profile.getToolsOrNull("SSBasedInspection", myFixture.getProject()); final SSBasedInspection inspection = (SSBasedInspection)tools.getTool().getTool(); final PsiFile file = myFixture.getFile(); - PlatformTestUtil.startPerformanceTest("Chained method call inspection performance", 1500, + PlatformTestUtil.startPerformanceTest("Chained method call inspection performance", () -> InspectionEngine.inspectEx( Collections.singletonList(new LocalInspectionToolWrapper(inspection)), file, file.getTextRange(), diff --git a/platform/util/testSrc/com/intellij/openapi/util/DisposerTest.java b/platform/util/testSrc/com/intellij/openapi/util/DisposerTest.java index 7c84503aaa9d..b473e945dfd6 100644 --- a/platform/util/testSrc/com/intellij/openapi/util/DisposerTest.java +++ b/platform/util/testSrc/com/intellij/openapi/util/DisposerTest.java @@ -668,7 +668,7 @@ public class DisposerTest { Disposable root = Disposer.newDisposable("test_root"); Disposable[] children = IntStream.range(0, N).mapToObj(i -> Disposer.newDisposable("child " + i)).toArray(Disposable[]::new); - PlatformTestUtil.startPerformanceTest(name.getMethodName(), 15_000, () -> { + PlatformTestUtil.startPerformanceTest(name.getMethodName(), () -> { for (Disposable child : children) { Disposer.register(root, child); } diff --git a/platform/util/testSrc/com/intellij/util/text/ImmutableTextTest.java b/platform/util/testSrc/com/intellij/util/text/ImmutableTextTest.java index 85bc0f11e354..aeff2b0b44c3 100644 --- a/platform/util/testSrc/com/intellij/util/text/ImmutableTextTest.java +++ b/platform/util/testSrc/com/intellij/util/text/ImmutableTextTest.java @@ -23,7 +23,7 @@ public class ImmutableTextTest extends UsefulTestCase { public void testDeleteAllPerformance() { ImmutableText original = ImmutableText.valueOf(StringUtil.repeat("abcdefghij", 1_900_000)); - PlatformTestUtil.startPerformanceTest("Deletion of all contents must be fast", 100, () -> { + PlatformTestUtil.startPerformanceTest("Deletion of all contents must be fast", () -> { for (int iter = 0; iter < 100000; iter++) { ImmutableText another = original.delete(0, original.length()); assertEquals(0, another.length()); diff --git a/platform/vcs-impl/testSrc/com/intellij/openapi/vcs/changes/HierarchicalFilePathComparatorTest.java b/platform/vcs-impl/testSrc/com/intellij/openapi/vcs/changes/HierarchicalFilePathComparatorTest.java index aaecc101fa53..fb0f88333baa 100644 --- a/platform/vcs-impl/testSrc/com/intellij/openapi/vcs/changes/HierarchicalFilePathComparatorTest.java +++ b/platform/vcs-impl/testSrc/com/intellij/openapi/vcs/changes/HierarchicalFilePathComparatorTest.java @@ -275,21 +275,21 @@ public class HierarchicalFilePathComparatorTest extends TestCase { public void testNaturalPerformance() { List filePaths = generatePerformanceTestFilePaths(); - PlatformTestUtil.startPerformanceTest("Natural hierarchical comparator", 7000, () -> { + PlatformTestUtil.startPerformanceTest("Natural hierarchical comparator", () -> { assertComparisonContractNotViolated(filePaths, HierarchicalFilePathComparator.NATURAL); }).assertTiming(); } public void testCaseInsensitivePerformance() { List filePaths = generatePerformanceTestFilePaths(); - PlatformTestUtil.startPerformanceTest("Case-insensitive hierarchical comparator", 4000, () -> { + PlatformTestUtil.startPerformanceTest("Case-insensitive hierarchical comparator", () -> { assertComparisonContractNotViolated(filePaths, HierarchicalFilePathComparator.CASE_INSENSITIVE); }).assertTiming(); } public void testCaseSensitivePerformance() { List filePaths = generatePerformanceTestFilePaths(); - PlatformTestUtil.startPerformanceTest("Case-sensitive hierarchical comparator", 3000, () -> { + PlatformTestUtil.startPerformanceTest("Case-sensitive hierarchical comparator", () -> { assertComparisonContractNotViolated(filePaths, HierarchicalFilePathComparator.CASE_SENSITIVE); }).assertTiming(); } diff --git a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/DirectoryMappingListTest.kt b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/DirectoryMappingListTest.kt index 9ce6a96f78bf..59371647d659 100644 --- a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/DirectoryMappingListTest.kt +++ b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/DirectoryMappingListTest.kt @@ -338,7 +338,7 @@ class DirectoryMappingListTest : HeavyPlatformTestCase() { "$rootPath/parent/non_existent/some/path" ).map { it.filePath } - PlatformTestUtil.startPerformanceTest("NewMappings few roots FilePaths", 1000) { + PlatformTestUtil.startPerformanceTest("NewMappings few roots FilePaths") { for (i in 0..20000) { for (filePath in toCheck) { mappings.getMappedRootFor(filePath) @@ -361,7 +361,7 @@ class DirectoryMappingListTest : HeavyPlatformTestCase() { "$rootPath/non_existent/some/path" ).map { it.filePath } - PlatformTestUtil.startPerformanceTest("NewMappings many roots FilePaths", 1000) { + PlatformTestUtil.startPerformanceTest("NewMappings many roots FilePaths") { for (i in 0..20000) { for (filePath in toCheck) { mappings.getMappedRootFor(filePath) @@ -388,7 +388,7 @@ class DirectoryMappingListTest : HeavyPlatformTestCase() { "$rootPath/parent/" + "dir/".repeat(220) ).map { it.filePath } - PlatformTestUtil.startPerformanceTest("NewMappings nested roots FilePaths", 1000) { + PlatformTestUtil.startPerformanceTest("NewMappings nested roots FilePaths") { for (i in 0..2000) { for (filePath in toCheck) { mappings.getMappedRootFor(filePath) @@ -412,7 +412,7 @@ class DirectoryMappingListTest : HeavyPlatformTestCase() { "$rootPath/parent/non_existent/some/path" )) - PlatformTestUtil.startPerformanceTest("NewMappings few roots VirtualFiles", 500) { + PlatformTestUtil.startPerformanceTest("NewMappings few roots VirtualFiles") { for (i in 0..60000) { for (filePath in toCheck) { mappings.getMappedRootFor(filePath) @@ -435,7 +435,7 @@ class DirectoryMappingListTest : HeavyPlatformTestCase() { "$rootPath/non_existent/some/path" )) - PlatformTestUtil.startPerformanceTest("NewMappings many roots VirtualFiles", 500) { + PlatformTestUtil.startPerformanceTest("NewMappings many roots VirtualFiles") { for (i in 0..80000) { for (filePath in toCheck) { mappings.getMappedRootFor(filePath) @@ -462,7 +462,7 @@ class DirectoryMappingListTest : HeavyPlatformTestCase() { "$rootPath/parent/" + "dir/".repeat(200) )) - PlatformTestUtil.startPerformanceTest("NewMappings nested roots VirtualFiles", 500) { + PlatformTestUtil.startPerformanceTest("NewMappings nested roots VirtualFiles") { for (i in 0..15000) { for (filePath in toCheck) { mappings.getMappedRootFor(filePath) diff --git a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/LineStatusTrackerModifyPerformanceTest.kt b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/LineStatusTrackerModifyPerformanceTest.kt index 15a6ab9323d1..e2c8c81c3197 100644 --- a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/LineStatusTrackerModifyPerformanceTest.kt +++ b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/LineStatusTrackerModifyPerformanceTest.kt @@ -16,7 +16,7 @@ class LineStatusTrackerModifyPerformanceTest : BaseLineStatusTrackerTestCase() { val text1 = sb1.toString() val text2 = sb2.toString() - PlatformTestUtil.startPerformanceTest(PlatformTestUtil.getTestName(name, true), 7000) { + PlatformTestUtil.startPerformanceTest(PlatformTestUtil.getTestName(name, true)) { test(text1) { tracker.doFrozen(Runnable { simpleTracker.setBaseRevision(text2) @@ -41,7 +41,7 @@ class LineStatusTrackerModifyPerformanceTest : BaseLineStatusTrackerTestCase() { val text2 = sb2.toString() val text3 = sb3.toString() - PlatformTestUtil.startPerformanceTest(PlatformTestUtil.getTestName(name, true), 10000) { + PlatformTestUtil.startPerformanceTest(PlatformTestUtil.getTestName(name, true)) { test(text1, text2) { tracker.doFrozen(Runnable { simpleTracker.setBaseRevision(text3) diff --git a/platform/workspace/jps/tests/testSrc/com/intellij/workspaceModel/ide/WorkspaceModelBenchmarksPerformanceTest.kt b/platform/workspace/jps/tests/testSrc/com/intellij/workspaceModel/ide/WorkspaceModelBenchmarksPerformanceTest.kt index 72d02ec220ee..4b951cca8f06 100644 --- a/platform/workspace/jps/tests/testSrc/com/intellij/workspaceModel/ide/WorkspaceModelBenchmarksPerformanceTest.kt +++ b/platform/workspace/jps/tests/testSrc/com/intellij/workspaceModel/ide/WorkspaceModelBenchmarksPerformanceTest.kt @@ -94,7 +94,7 @@ class WorkspaceModelBenchmarksPerformanceTest { var storage = MutableEntityStorage.create().toSnapshot() val times = 20_000 - PlatformTestUtil.startPerformanceTest(testInfo.displayName, 100500) { + PlatformTestUtil.startPerformanceTest(testInfo.displayName) { repeat(times) { val builder = storage.toBuilder() @@ -119,7 +119,7 @@ class WorkspaceModelBenchmarksPerformanceTest { val times = 2_000_000 - PlatformTestUtil.startPerformanceTest(testInfo.displayName, 100500) { + PlatformTestUtil.startPerformanceTest(testInfo.displayName) { repeat(times) { val entity = storage.entities(NamedEntity::class.java).single() blackhole(entity) @@ -139,7 +139,7 @@ class WorkspaceModelBenchmarksPerformanceTest { val times = 2_000_000 val parents = ArrayList(times) - PlatformTestUtil.startPerformanceTest("Named entities adding", 100500) { + PlatformTestUtil.startPerformanceTest("Named entities adding") { repeat(times) { parents += builder addEntity NamedEntity("$it", MySource) } @@ -147,7 +147,7 @@ class WorkspaceModelBenchmarksPerformanceTest { .warmupIterations(0) .attempts(1).assertTimingAsSubtest() - PlatformTestUtil.startPerformanceTest("Soft linked entities adding", 100500) { + PlatformTestUtil.startPerformanceTest("Soft linked entities adding") { for (parent in parents) { builder addEntity ComposedIdSoftRefEntity("-${parent.myName}", parent.symbolicId, MySource) } @@ -168,7 +168,7 @@ class WorkspaceModelBenchmarksPerformanceTest { val storage = builder.toSnapshot() val newBuilder = storage.toBuilder() - PlatformTestUtil.startPerformanceTest(testInfo.displayName, 100500) { + PlatformTestUtil.startPerformanceTest(testInfo.displayName) { repeat(size) { val value = newBuilder.resolve(NameId("$it"))!! newBuilder.modifyEntity(value) { @@ -193,7 +193,7 @@ class WorkspaceModelBenchmarksPerformanceTest { val storage = builder.toSnapshot() val list = mutableListOf() - PlatformTestUtil.startPerformanceTest(testInfo.displayName, 100500) { + PlatformTestUtil.startPerformanceTest(testInfo.displayName) { repeat(size) { list.addAll(storage.referrers(NameId("$it"), ComposedIdSoftRefEntity::class.java).toList()) } @@ -218,7 +218,7 @@ class WorkspaceModelBenchmarksPerformanceTest { val file = Files.createTempFile("tmpModel", "") try { - PlatformTestUtil.startPerformanceTest("${testInfo.displayName} - Serialization", 100500) { + PlatformTestUtil.startPerformanceTest("${testInfo.displayName} - Serialization") { repeat(200) { serializer.serializeCache(file, storage) } @@ -226,7 +226,7 @@ class WorkspaceModelBenchmarksPerformanceTest { .warmupIterations(0) .attempts(1).assertTimingAsSubtest() - PlatformTestUtil.startPerformanceTest("${testInfo.displayName} - Deserialization", 100500) { + PlatformTestUtil.startPerformanceTest("${testInfo.displayName} - Deserialization") { repeat(200) { sizes += Files.size(file).toInt() serializer.deserializeCache(file).getOrThrow() @@ -235,7 +235,7 @@ class WorkspaceModelBenchmarksPerformanceTest { .warmupIterations(0) .attempts(1).assertTimingAsSubtest() - PlatformTestUtil.startPerformanceTest("${testInfo.displayName} - SerializationFromFile", 100500) { + PlatformTestUtil.startPerformanceTest("${testInfo.displayName} - SerializationFromFile") { repeat(200) { serializer.serializeCache(file, storage) } @@ -243,7 +243,7 @@ class WorkspaceModelBenchmarksPerformanceTest { .warmupIterations(0) .attempts(1).assertTimingAsSubtest() - PlatformTestUtil.startPerformanceTest("${testInfo.displayName} - DeserializationFromFile", 100500) { + PlatformTestUtil.startPerformanceTest("${testInfo.displayName} - DeserializationFromFile") { repeat(200) { serializer.deserializeCache(file).getOrThrow() } @@ -279,7 +279,7 @@ class WorkspaceModelBenchmarksPerformanceTest { }) } - PlatformTestUtil.startPerformanceTest(testInfo.displayName, 100500) { + PlatformTestUtil.startPerformanceTest(testInfo.displayName) { storageBuilder.replaceBySource({ true }, replaceStorage) } .warmupIterations(0) @@ -288,7 +288,7 @@ class WorkspaceModelBenchmarksPerformanceTest { @Test fun `project model updates`(testInfo: TestInfo) { - PlatformTestUtil.startPerformanceTest(testInfo.displayName, 100500) { + PlatformTestUtil.startPerformanceTest(testInfo.displayName) { runWriteActionAndWait { measureTimeMillis { repeat(10_000) { @@ -308,7 +308,7 @@ class WorkspaceModelBenchmarksPerformanceTest { val manager = WorkspaceModel.getInstance(projectModel.project).getVirtualFileUrlManager() val newFolder = tempFolder.newRandomDirectory() - PlatformTestUtil.startPerformanceTest(testInfo.displayName, 100500) { + PlatformTestUtil.startPerformanceTest(testInfo.displayName) { runWriteActionAndWait { measureTimeMillis { EntitiesOrphanage.getInstance(projectModel.project).update { @@ -344,7 +344,7 @@ class WorkspaceModelBenchmarksPerformanceTest { val newFolder = VfsUtilCore.pathToUrl(tempFolder.newRandomDirectory().toString()) val manager = WorkspaceModel.getInstance(projectModel.project).getVirtualFileUrlManager() - PlatformTestUtil.startPerformanceTest(testInfo.displayName, 100500) { + PlatformTestUtil.startPerformanceTest(testInfo.displayName) { runWriteActionAndWait { measureTimeMillis { EntitiesOrphanage.getInstance(projectModel.project).update { @@ -391,7 +391,7 @@ class WorkspaceModelBenchmarksPerformanceTest { val newFolder = tempFolder.newRandomDirectory() val manager = WorkspaceModel.getInstance(projectModel.project).getVirtualFileUrlManager() - PlatformTestUtil.startPerformanceTest(testInfo.displayName, 100500) { + PlatformTestUtil.startPerformanceTest(testInfo.displayName) { runWriteActionAndWait { measureTimeMillis { EntitiesOrphanage.getInstance(projectModel.project).update { @@ -434,7 +434,7 @@ class WorkspaceModelBenchmarksPerformanceTest { @Test fun `update storage via replaceProjectModel`(testInfo: TestInfo) { - PlatformTestUtil.startPerformanceTest(testInfo.displayName, 100500) { + PlatformTestUtil.startPerformanceTest(testInfo.displayName) { runWriteActionAndWait { repeat(1000) { val builderSnapshot = WorkspaceModel.getInstance(projectModel.project).internal.getBuilderSnapshot() @@ -505,7 +505,7 @@ class WorkspaceModelBenchmarksPerformanceTest { } as MutableEntityStorageInstrumentation } - PlatformTestUtil.startPerformanceTest(testInfo.displayName, 100500) { + PlatformTestUtil.startPerformanceTest(testInfo.displayName) { builders.forEach { it.collectChanges() } } .warmupIterations(0) @@ -555,7 +555,7 @@ class WorkspaceModelBenchmarksPerformanceTest { } } - PlatformTestUtil.startPerformanceTest(testInfo.displayName, 100500) { + PlatformTestUtil.startPerformanceTest(testInfo.displayName) { builders.zip(newBuilders).forEach { (initial, update) -> initial.applyChangesFrom(update) } @@ -586,7 +586,7 @@ class WorkspaceModelBenchmarksPerformanceTest { builder.toSnapshot().toBuilder() } - PlatformTestUtil.startPerformanceTest(testInfo.displayName, 100500) { + PlatformTestUtil.startPerformanceTest(testInfo.displayName) { builders.forEach { builder -> // Populate builder with changes repeat(1000) { @@ -642,7 +642,7 @@ class WorkspaceModelBenchmarksPerformanceTest { val childData = entities().flatMap { parentEntity, _ -> parentEntity.children }.map { it.childData } // Do first request - PlatformTestUtil.startPerformanceTest("${testInfo.displayName} - First Access", 100500) { + PlatformTestUtil.startPerformanceTest("${testInfo.displayName} - First Access") { snapshots.forEach { snapshot -> snapshot.cached(namesOfNamedEntities) snapshot.cached(sourcesByName) @@ -653,7 +653,7 @@ class WorkspaceModelBenchmarksPerformanceTest { .attempts(1).assertTimingAsSubtest() // Do second request without any modifications - PlatformTestUtil.startPerformanceTest("${testInfo.displayName} - Second Access - No Changes", 100500) { + PlatformTestUtil.startPerformanceTest("${testInfo.displayName} - Second Access - No Changes") { snapshots.forEach { snapshot -> snapshot.cached(namesOfNamedEntities) snapshot.cached(sourcesByName) @@ -692,7 +692,7 @@ class WorkspaceModelBenchmarksPerformanceTest { println("Start third read...") // Do request after modifications - PlatformTestUtil.startPerformanceTest("${testInfo.displayName} - Third Access - After Modification", 100500) { + PlatformTestUtil.startPerformanceTest("${testInfo.displayName} - Third Access - After Modification") { newSnapshots.forEach { snapshot -> snapshot.cached(namesOfNamedEntities) snapshot.cached(sourcesByName) @@ -732,7 +732,7 @@ class WorkspaceModelBenchmarksPerformanceTest { Assertions.assertFalse(CacheResetTracker.cacheReset) - PlatformTestUtil.startPerformanceTest("${testInfo.displayName} - Fourth Access - After Second Modification", 100500) { + PlatformTestUtil.startPerformanceTest("${testInfo.displayName} - Fourth Access - After Second Modification") { snapshotsWithLotOfUpdates.forEach { snapshot -> snapshot.cached(namesOfNamedEntities) snapshot.cached(sourcesByName) @@ -760,7 +760,7 @@ class WorkspaceModelBenchmarksPerformanceTest { Assertions.assertTrue(CacheResetTracker.cacheReset) println("Read fourth time") - PlatformTestUtil.startPerformanceTest("${testInfo.displayName} - Fifth Access - After a Lot of Modifications", 100500) { + PlatformTestUtil.startPerformanceTest("${testInfo.displayName} - Fifth Access - After a Lot of Modifications") { snapshotsWithTonsOfUpdates.forEach { snapshot -> snapshot.cached(namesOfNamedEntities) snapshot.cached(sourcesByName) @@ -818,7 +818,7 @@ class WorkspaceModelBenchmarksPerformanceTest { var mySnapshot = builder.toSnapshot() - PlatformTestUtil.startPerformanceTest(testInfo.displayName, 100500) { + PlatformTestUtil.startPerformanceTest(testInfo.displayName) { repeat(size) { val myBuilder = mySnapshot.toBuilder() val entity = myBuilder.resolve(NameId("Name$it"))!! @@ -843,7 +843,7 @@ class WorkspaceModelBenchmarksPerformanceTest { var snapshot = builder.toSnapshot() println("Test one --- Raw recalculate") - PlatformTestUtil.startPerformanceTest(testInfo.displayName + " raw calculate - size: $size", 100500) { + PlatformTestUtil.startPerformanceTest(testInfo.displayName + " raw calculate - size: $size") { val time = measureTime { snapshot.entities().map { it.myName }.toList() } @@ -854,7 +854,7 @@ class WorkspaceModelBenchmarksPerformanceTest { println() println("Test two --- First calculate") - PlatformTestUtil.startPerformanceTest(testInfo.displayName + "- first calculate - size: $size", 100500) { + PlatformTestUtil.startPerformanceTest(testInfo.displayName + "- first calculate - size: $size") { val time2 = measureTime { snapshot.cached(q) } @@ -865,7 +865,7 @@ class WorkspaceModelBenchmarksPerformanceTest { println() println("Test three --- Unmodified second access") - PlatformTestUtil.startPerformanceTest(testInfo.displayName + "- second access - size: $size", 100500) { + PlatformTestUtil.startPerformanceTest(testInfo.displayName + "- second access - size: $size") { val time3 = measureTime { snapshot.cached(q) } @@ -878,7 +878,7 @@ class WorkspaceModelBenchmarksPerformanceTest { println() println("Test four --- Add one entity") - PlatformTestUtil.startPerformanceTest(testInfo.displayName + "- Add one entity - size: $size", 100500) { + PlatformTestUtil.startPerformanceTest(testInfo.displayName + "- Add one entity - size: $size") { val time4 = measureTime { snapshot.cached(q) } @@ -906,7 +906,7 @@ class WorkspaceModelBenchmarksPerformanceTest { println() println("Test five --- Update 10% of entities") - PlatformTestUtil.startPerformanceTest(testInfo.displayName + "- Affect 10% of entities - size: $size", 100500) { + PlatformTestUtil.startPerformanceTest(testInfo.displayName + "- Affect 10% of entities - size: $size") { val time5 = measureTime { snapshot.cached(q) } @@ -936,7 +936,7 @@ class WorkspaceModelBenchmarksPerformanceTest { var snapshot = builder.toSnapshot() println("Test one --- Raw recalculate") - PlatformTestUtil.startPerformanceTest(testInfo.displayName + " raw calculate - size: $size", 100500) { + PlatformTestUtil.startPerformanceTest(testInfo.displayName + " raw calculate - size: $size") { val time = measureTime { snapshot.entities() .flatMap { it.children } @@ -951,7 +951,7 @@ class WorkspaceModelBenchmarksPerformanceTest { println() println("Test two --- First calculate") - PlatformTestUtil.startPerformanceTest(testInfo.displayName + "- first calculate - size: $size", 100500) { + PlatformTestUtil.startPerformanceTest(testInfo.displayName + "- first calculate - size: $size") { val time2 = measureTime { snapshot.cached(q) } @@ -962,7 +962,7 @@ class WorkspaceModelBenchmarksPerformanceTest { println() println("Test three --- Unmodified second access") - PlatformTestUtil.startPerformanceTest(testInfo.displayName + "- second access - size: $size", 100500) { + PlatformTestUtil.startPerformanceTest(testInfo.displayName + "- second access - size: $size") { val time3 = measureTime { snapshot.cached(q) } @@ -979,7 +979,7 @@ class WorkspaceModelBenchmarksPerformanceTest { println() println("Test four --- Add one entity") - PlatformTestUtil.startPerformanceTest(testInfo.displayName + "- Add one entity - size: $size", 100500) { + PlatformTestUtil.startPerformanceTest(testInfo.displayName + "- Add one entity - size: $size") { val time4 = measureTime { snapshot.cached(q) } @@ -1014,7 +1014,7 @@ class WorkspaceModelBenchmarksPerformanceTest { println() println("Test five --- Update 10% of entities") - PlatformTestUtil.startPerformanceTest(testInfo.displayName + "- Affect 10% of entities - size: $size", 100500) { + PlatformTestUtil.startPerformanceTest(testInfo.displayName + "- Affect 10% of entities - size: $size") { val time51 = measureTime { snapshot.cached(q) } @@ -1126,7 +1126,7 @@ class WorkspaceModelBenchmarksPerformanceTest { fun `get for kotlin persistent map`(size: Int) { val requestSize = 10_000_000 - PlatformTestUtil.startPerformanceTest(size.toString(), 100500) { + PlatformTestUtil.startPerformanceTest(size.toString()) { testPersistentMap(size, requestSize) } .warmupIterations(0) @@ -1154,13 +1154,13 @@ class WorkspaceModelBenchmarksPerformanceTest { private fun measureOperation(launchName: String, singleBuilderEntities: List>, perBuilderEntities: List>, operation: (Int, Pair) -> Unit): Unit { - PlatformTestUtil.startPerformanceTest("$launchName-singleBuilderEntities", 100500) { + PlatformTestUtil.startPerformanceTest("$launchName-singleBuilderEntities") { singleBuilderEntities.forEachIndexed(operation) } .warmupIterations(0) .attempts(1).assertTimingAsSubtest() - PlatformTestUtil.startPerformanceTest("$launchName-perBuilderEntities", 100500) { + PlatformTestUtil.startPerformanceTest("$launchName-perBuilderEntities") { perBuilderEntities.forEachIndexed(operation) } .warmupIterations(0) diff --git a/platform/workspace/jps/tests/testSrc/com/intellij/workspaceModel/ide/WorkspaceModelPerformanceTest.kt b/platform/workspace/jps/tests/testSrc/com/intellij/workspaceModel/ide/WorkspaceModelPerformanceTest.kt index dbd0228491ff..89153c0402ba 100644 --- a/platform/workspace/jps/tests/testSrc/com/intellij/workspaceModel/ide/WorkspaceModelPerformanceTest.kt +++ b/platform/workspace/jps/tests/testSrc/com/intellij/workspaceModel/ide/WorkspaceModelPerformanceTest.kt @@ -100,7 +100,7 @@ class WorkspaceModelPerformanceTest { @Test fun `add remove module`() { - PlatformTestUtil.startPerformanceTest("Adding and removing a module 10 times", 125) { + PlatformTestUtil.startPerformanceTest("Adding and removing a module 10 times") { repeat(10) { val module = ourProjectModel.createModule("newModule") ourProjectModel.removeModule(module) @@ -110,7 +110,7 @@ class WorkspaceModelPerformanceTest { @Test fun `add remove project library`() { - PlatformTestUtil.startPerformanceTest("Adding and removing a project library 30 times", 125) { + PlatformTestUtil.startPerformanceTest("Adding and removing a project library 30 times") { repeat(30) { val library = ourProjectModel.addProjectLevelLibrary("newLibrary") { it.addRoot(ourProjectRoot.append("newLibrary/classes").url, OrderRootType.CLASSES) @@ -125,7 +125,7 @@ class WorkspaceModelPerformanceTest { @Test fun `add remove module library`() { val module = ourProjectModel.moduleManager.findModuleByName("module50")!! - PlatformTestUtil.startPerformanceTest("Adding and removing a module library 10 times", 200) { + PlatformTestUtil.startPerformanceTest("Adding and removing a module library 10 times") { repeat(10) { val library = ourProjectModel.addModuleLevelLibrary(module, "newLibrary") { it.addRoot(ourProjectRoot.append("newLibrary/classes").url, OrderRootType.CLASSES) @@ -141,7 +141,7 @@ class WorkspaceModelPerformanceTest { fun `add remove dependency`() { val module = ourProjectModel.moduleManager.findModuleByName("module50")!! val library = ourProjectModel.projectLibraryTable.getLibraryByName("lib40")!! - PlatformTestUtil.startPerformanceTest("Adding and removing a dependency 20 times", 250) { + PlatformTestUtil.startPerformanceTest("Adding and removing a dependency 20 times") { repeat(20) { ModuleRootModificationUtil.addDependency(module, library) ModuleRootModificationUtil.removeDependency(module, library) @@ -151,7 +151,7 @@ class WorkspaceModelPerformanceTest { @Test fun `process content roots`() { - PlatformTestUtil.startPerformanceTest("Iterate through content roots of all modules 1000 times", 80) { + PlatformTestUtil.startPerformanceTest("Iterate through content roots of all modules 1000 times") { var count = 0 repeat(1000) { ourProjectModel.moduleManager.modules.forEach { module -> @@ -164,7 +164,7 @@ class WorkspaceModelPerformanceTest { @Test fun `process order entries`() { - PlatformTestUtil.startPerformanceTest("Iterate through order entries of all modules 1000 times", 60) { + PlatformTestUtil.startPerformanceTest("Iterate through order entries of all modules 1000 times") { var count = 0 repeat(1000) { ourProjectModel.moduleManager.modules.forEach { module -> diff --git a/plugins/ant/tests/src/com/intellij/lang/ant/AntHighlightingPerformanceTest.java b/plugins/ant/tests/src/com/intellij/lang/ant/AntHighlightingPerformanceTest.java index 0387fbfd3748..60bd8b93e48e 100644 --- a/plugins/ant/tests/src/com/intellij/lang/ant/AntHighlightingPerformanceTest.java +++ b/plugins/ant/tests/src/com/intellij/lang/ant/AntHighlightingPerformanceTest.java @@ -25,7 +25,7 @@ public class AntHighlightingPerformanceTest extends DaemonAnalyzerTestCase { findVirtualFile(getTestName(false) + ".xml"), findVirtualFile("buildserver.xml"), findVirtualFile("buildserver.properties")); - PlatformTestUtil.startPerformanceTest("Big ant file highlighting", 15_000, () -> doDoTest(true, false)) + PlatformTestUtil.startPerformanceTest("Big ant file highlighting", () -> doDoTest(true, false)) .setup(getPsiManager()::dropPsiCaches) .assertTiming(); } diff --git a/plugins/devkit/devkit-java-tests/testSrc/org/jetbrains/idea/devkit/util/ExtensionLocatorPerformanceTest.java b/plugins/devkit/devkit-java-tests/testSrc/org/jetbrains/idea/devkit/util/ExtensionLocatorPerformanceTest.java index db2f918aa06d..4986eab02b18 100644 --- a/plugins/devkit/devkit-java-tests/testSrc/org/jetbrains/idea/devkit/util/ExtensionLocatorPerformanceTest.java +++ b/plugins/devkit/devkit-java-tests/testSrc/org/jetbrains/idea/devkit/util/ExtensionLocatorPerformanceTest.java @@ -30,7 +30,7 @@ public class ExtensionLocatorPerformanceTest extends JavaCodeInsightFixtureTestC myFixture.configureByText("plugin.xml", generatePluginXmlText(randomMethodNames)); PsiClass psiClass = myFixture.addClass(generateJavaClassText(randomMethodNames)); - PlatformTestUtil.startPerformanceTest("Locating extension tag by PsiClass", 2000, () -> { + PlatformTestUtil.startPerformanceTest("Locating extension tag by PsiClass", () -> { List result = locateExtensionsByPsiClass(psiClass); assertSize(1, result); }).attempts(1).assertTiming(); diff --git a/plugins/editorconfig/test/org/editorconfig/language/codeinsight/EditorConfigInspectionsTest.kt b/plugins/editorconfig/test/org/editorconfig/language/codeinsight/EditorConfigInspectionsTest.kt index a2afe1ad85b3..55b4ed331497 100644 --- a/plugins/editorconfig/test/org/editorconfig/language/codeinsight/EditorConfigInspectionsTest.kt +++ b/plugins/editorconfig/test/org/editorconfig/language/codeinsight/EditorConfigInspectionsTest.kt @@ -101,21 +101,21 @@ class EditorConfigInspectionsTest : BasePlatformTestCase() { ) fun testHeaderProcessingPerformance() { - doTestPerf(5000, EditorConfigNoMatchingFilesInspection::class) + doTestPerf(EditorConfigNoMatchingFilesInspection::class) } fun testHeaderProcessingPerformance2() { - doTestPerf(7000, EditorConfigPatternRedundancyInspection::class) + doTestPerf(EditorConfigPatternRedundancyInspection::class) } fun testHeaderProcessingPerformance3() { - doTestPerf(5000, EditorConfigHeaderUniquenessInspection::class) + doTestPerf(EditorConfigHeaderUniquenessInspection::class) } - private fun doTestPerf(expectedMs: Int, inspection: KClass) { + private fun doTestPerf(inspection: KClass) { myFixture.enableInspections(inspection.java) myFixture.configureByFile("${getTestName(true)}/.editorconfig") - PlatformTestUtil.startPerformanceTest("${inspection.simpleName} performance", expectedMs, ThrowableRunnable { + PlatformTestUtil.startPerformanceTest("${inspection.simpleName} performance", ThrowableRunnable { myFixture.doHighlighting() }).attempts(1).assertTiming() } diff --git a/plugins/gradle/java/testSources/dsl/GradleHighlightingPerformanceTest.kt b/plugins/gradle/java/testSources/dsl/GradleHighlightingPerformanceTest.kt index 1c681da86b6d..7ba0476a6f08 100644 --- a/plugins/gradle/java/testSources/dsl/GradleHighlightingPerformanceTest.kt +++ b/plugins/gradle/java/testSources/dsl/GradleHighlightingPerformanceTest.kt @@ -32,7 +32,7 @@ class GradleHighlightingPerformanceTest : GradleCodeInsightTestCase() { fixture.editor.caretModel.moveToOffset(pos + 1) fixture.checkHighlighting() - PlatformTestUtil.startPerformanceTest("GradleHighlightingPerformanceTest.testPerformance", 6000) { + PlatformTestUtil.startPerformanceTest("GradleHighlightingPerformanceTest.testPerformance") { fixture.psiManager.dropPsiCaches() repeat(4) { fixture.type('a') @@ -60,7 +60,7 @@ class GradleHighlightingPerformanceTest : GradleCodeInsightTestCase() { val document = PsiDocumentManager.getInstance(project).getDocument(fixture.file) disableSlowCompletionElements(fixture.testRootDisposable) val repeatSize = 10 - PlatformTestUtil.startPerformanceTest("GradleHighlightingPerformanceTest.testCompletion", 450 * repeatSize) { + PlatformTestUtil.startPerformanceTest("GradleHighlightingPerformanceTest.testCompletion") { fixture.psiManager.dropResolveCaches() repeat(repeatSize) { val lookupElements = fixture.completeBasic() @@ -70,7 +70,7 @@ class GradleHighlightingPerformanceTest : GradleCodeInsightTestCase() { val rangeMarkers = ArrayList() document.asSafely()?.processRangeMarkers { rangeMarkers.add(it) } rangeMarkers.forEach { marker -> document.asSafely()?.removeRangeMarker(marker as RangeMarkerEx) } - }.usesAllCPUCores().assertTiming(GradleHighlightingPerformanceTest::testCompletionPerformance) + }.assertTiming(GradleHighlightingPerformanceTest::testCompletionPerformance) } } } diff --git a/plugins/grazie/src/test/kotlin/com/intellij/grazie/ide/language/JavaSupportTest.kt b/plugins/grazie/src/test/kotlin/com/intellij/grazie/ide/language/JavaSupportTest.kt index 7069865f96f4..81dd86121fd1 100644 --- a/plugins/grazie/src/test/kotlin/com/intellij/grazie/ide/language/JavaSupportTest.kt +++ b/plugins/grazie/src/test/kotlin/com/intellij/grazie/ide/language/JavaSupportTest.kt @@ -43,16 +43,16 @@ class JavaSupportTest : GrazieTestBase() { } fun `test long comment performance`() { - PlatformTestUtil.startPerformanceTest("highlighting", 1000) { + PlatformTestUtil.startPerformanceTest("highlighting") { runHighlightTestForFile("ide/language/java/LongCommentPerformance.java") - }.setup { psiManager.dropPsiCaches() }.usesAllCPUCores().assertTiming() + }.setup { psiManager.dropPsiCaches() }.assertTiming() } fun `test performance with many line comments`() { val text = "// this is a single line comment\n".repeat(5000) myFixture.configureByText("a.java", text) - PlatformTestUtil.startPerformanceTest("highlighting", 2000) { + PlatformTestUtil.startPerformanceTest("highlighting") { myFixture.checkHighlighting() - }.setup { psiManager.dropPsiCaches() }.usesAllCPUCores().assertTiming() + }.setup { psiManager.dropPsiCaches() }.assertTiming() } } diff --git a/plugins/grazie/src/test/kotlin/com/intellij/grazie/text/TextExtractionTest.java b/plugins/grazie/src/test/kotlin/com/intellij/grazie/text/TextExtractionTest.java index 08ac386db446..b62993758c7c 100644 --- a/plugins/grazie/src/test/kotlin/com/intellij/grazie/text/TextExtractionTest.java +++ b/plugins/grazie/src/test/kotlin/com/intellij/grazie/text/TextExtractionTest.java @@ -229,7 +229,7 @@ public class TextExtractionTest extends BasePlatformTestCase { PsiFile file = myFixture.configureByText("a.xml", text); PlatformTestUtil - .startPerformanceTest("text extraction", 1_000, () -> { + .startPerformanceTest("text extraction", () -> { assertEquals("content", TextExtractor.findTextAt(file, offset1, TextContent.TextDomain.ALL).toString()); assertNull(TextExtractor.findTextAt(file, offset2, TextContent.TextDomain.ALL)); }) @@ -247,7 +247,7 @@ public class TextExtractionTest extends BasePlatformTestCase { PsiFile file = myFixture.configureByText("a.xml", text); PlatformTestUtil - .startPerformanceTest("text extraction", 1_500, () -> { + .startPerformanceTest("text extraction", () -> { for (PsiElement element : SyntaxTraverser.psiTraverser(file)) { TextExtractor.findTextsAt(element, TextContent.TextDomain.ALL); } @@ -305,7 +305,7 @@ public class TextExtractionTest extends BasePlatformTestCase { String expected = "b".repeat(10_000); PsiFile file = myFixture.configureByText("a.xml", text); TextContentBuilder builder = TextContentBuilder.FromPsi.excluding(e -> e instanceof XmlTag); - PlatformTestUtil.startPerformanceTest("TextContent building with concatenation", 200, () -> { + PlatformTestUtil.startPerformanceTest("TextContent building with concatenation", () -> { assertEquals(expected, builder.build(file, TextContent.TextDomain.PLAIN_TEXT).toString()); }).assertTiming(); } @@ -316,7 +316,7 @@ public class TextExtractionTest extends BasePlatformTestCase { PsiFile file = myFixture.configureByText("a.java", "/*\n" + text + "*/"); PsiComment comment = assertInstanceOf(file.findElementAt(10), PsiComment.class); TextContentBuilder builder = TextContentBuilder.FromPsi.removingIndents(" "); - PlatformTestUtil.startPerformanceTest("TextContent building with indent removing", 200, () -> { + PlatformTestUtil.startPerformanceTest("TextContent building with indent removing", () -> { assertEquals(expected, builder.build(comment, TextContent.TextDomain.COMMENTS).toString()); }).assertTiming(); } @@ -327,7 +327,7 @@ public class TextExtractionTest extends BasePlatformTestCase { PsiFile file = myFixture.configureByText("a.java", "/**\n" + text + "*/"); PsiDocComment comment = PsiTreeUtil.findElementOfClassAtOffset(file, 10, PsiDocComment.class, false); TextExtractor extractor = new JavaTextExtractor(); - PlatformTestUtil.startPerformanceTest("TextContent building with HTML removal", 200, () -> { + PlatformTestUtil.startPerformanceTest("TextContent building with HTML removal", () -> { assertEquals(expected, extractor.buildTextContent(comment, TextContent.TextDomain.ALL).toString()); }).assertTiming(); } @@ -338,7 +338,7 @@ public class TextExtractionTest extends BasePlatformTestCase { PsiFile file = myFixture.configureByText("a.md", text); var psi = PsiTreeUtil.findElementOfClassAtOffset(file, 10, MarkdownParagraph.class, false); TextExtractor extractor = new MarkdownTextExtractor(); - PlatformTestUtil.startPerformanceTest("TextContent building with nbsp removal", 200, () -> { + PlatformTestUtil.startPerformanceTest("TextContent building with nbsp removal", () -> { assertEquals(expected, extractor.buildTextContent(psi, TextContent.TextDomain.ALL).toString()); }).assertTiming(); } @@ -350,7 +350,7 @@ public class TextExtractionTest extends BasePlatformTestCase { PsiFile file = myFixture.configureByText("a.java", "class C { String s = \"\"\"\n" + text + "\"\"\"; }"); var literal = PsiTreeUtil.findElementOfClassAtOffset(file, 100, PsiLiteralExpression.class, false); var extractor = new JavaTextExtractor(); - PlatformTestUtil.startPerformanceTest("TextContent building from a long text fragment", 200, () -> { + PlatformTestUtil.startPerformanceTest("TextContent building from a long text fragment", () -> { assertEquals(expected, extractor.buildTextContent(literal, TextContent.TextDomain.ALL).toString()); }).assertTiming(); } @@ -361,7 +361,7 @@ public class TextExtractionTest extends BasePlatformTestCase { PsiFile file = myFixture.configureByText("a.java", text); TextExtractor extractor = new JavaTextExtractor(); PsiElement tag = PsiTreeUtil.findElementOfClassAtOffset(file, text.indexOf("something"), PsiDocTag.class, false); - PlatformTestUtil.startPerformanceTest("TextContent building from complex PSI", 400, () -> { + PlatformTestUtil.startPerformanceTest("TextContent building from complex PSI", () -> { for (int i = 0; i < 10; i++) { TextContent content = extractor.buildTextContent(tag, TextContent.TextDomain.ALL); assertEquals("something if is not too expensive", content.toString()); diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/GroovyStressPerformanceTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/GroovyStressPerformanceTest.groovy index 6cd7a91ed38c..76b6b5be5e48 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/GroovyStressPerformanceTest.groovy +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/GroovyStressPerformanceTest.groovy @@ -96,7 +96,7 @@ class GroovyStressPerformanceTest extends LightGroovyTestCase { myFixture.type 'foo {}\n' PsiDocumentManager.getInstance(project).commitAllDocuments() - PlatformTestUtil.startPerformanceTest(getTestName(false), 10000, { + PlatformTestUtil.startPerformanceTest(getTestName(false), { story.toCharArray().each { myFixture.type it PsiDocumentManager.getInstance(project).commitAllDocuments() @@ -112,11 +112,11 @@ class GroovyStressPerformanceTest extends LightGroovyTestCase { } text += "}" - measureHighlighting(text, 250) + measureHighlighting(text) } - private void measureHighlighting(String text, int time) { - PlatformTestUtil.startPerformanceTest(getTestName(false), time, configureAndHighlight(text)).usesAllCPUCores().assertTiming() + private void measureHighlighting(String text) { + PlatformTestUtil.startPerformanceTest(getTestName(false), configureAndHighlight(text)).assertTiming() } void testDeeplyNestedClosures() { @@ -128,7 +128,7 @@ class GroovyStressPerformanceTest extends LightGroovyTestCase { defs += "def foo$i(Closure cl) {}\n" } myFixture.enableInspections(new MissingReturnInspection()) - measureHighlighting(defs + text, 300) + measureHighlighting(defs + text) } void testDeeplyNestedClosuresInCompileStatic() { @@ -143,7 +143,7 @@ class GroovyStressPerformanceTest extends LightGroovyTestCase { myFixture.enableInspections(new MissingReturnInspection()) addCompileStatic() - measureHighlighting(defs + "\n @groovy.transform.CompileStatic def compiledStatically() {\ndef a = ''\n" + text + "\n}", 500) + measureHighlighting(defs + "\n @groovy.transform.CompileStatic def compiledStatically() {\ndef a = ''\n" + text + "\n}") } void testDeeplyNestedClosuresInGenericCalls() { @@ -154,7 +154,7 @@ class GroovyStressPerformanceTest extends LightGroovyTestCase { } myFixture.enableInspections(new MissingReturnInspection()) - measureHighlighting("def void foo(T t, Closure cl) {}\n$text", 1600) + measureHighlighting("def void foo(T t, Closure cl) {}\n$text") } void testDeeplyNestedClosuresInGenericCalls2() { @@ -164,17 +164,17 @@ class GroovyStressPerformanceTest extends LightGroovyTestCase { text = "foo(it) { $text }" } myFixture.enableInspections(new MissingReturnInspection()) - measureHighlighting("def void foo(T t, Closure cl) {}\n$text", 1200) + measureHighlighting("def void foo(T t, Closure cl) {}\n$text") } void testManyAnnotatedScriptVariables() { - measureHighlighting((0..100).collect { "@Anno String i$it = null" }.join("\n"), 1000) + measureHighlighting((0..100).collect { "@Anno String i$it = null" }.join("\n")) } void "test no recursion prevention when resolving supertype"() { RecursionManager.assertOnRecursionPrevention(myFixture.testRootDisposable) myFixture.addClass("interface Bar {}") - measureHighlighting("class Foo implements Bar {}", 200) + measureHighlighting("class Foo implements Bar {}") } void "test no recursion prevention when contributing constructors"() { @@ -189,7 +189,7 @@ class Foo implements Bar { void setBar(int bar) {} void someMethod(int a = 1) {} }""" - measureHighlighting(text, 200) + measureHighlighting(text) } void "test using non-reassigned for loop parameters"() { @@ -204,7 +204,7 @@ ${ } def bar(File file) { file.path } """ - measureHighlighting(text, 2000) + measureHighlighting(text) } void "test using SSA variables in a for loop"() { @@ -231,7 +231,7 @@ class SomeClass { void someMethod(String s) {} } """ - measureHighlighting(text, 7_000) + measureHighlighting(text) } void "test constructor call's"() { @@ -253,9 +253,8 @@ class Cl { } } """ - PlatformTestUtil.startPerformanceTest(getTestName(false), 750, configureAndHighlight(text)) + PlatformTestUtil.startPerformanceTest(getTestName(false), configureAndHighlight(text)) .attempts(20) - .usesAllCPUCores() .assertTiming() } @@ -275,7 +274,7 @@ while (true) { f.canoPath } ''' - PlatformTestUtil.startPerformanceTest(getTestName(false), 20_000, configureAndComplete(text)).attempts(1).usesAllCPUCores().assertTiming() + PlatformTestUtil.startPerformanceTest(getTestName(false), configureAndComplete(text)).attempts(1).assertTiming() } void testClosureRecursion() { @@ -448,7 +447,7 @@ class AwsService { } } ''' - measureHighlighting(text, 700) + measureHighlighting(text) } ThrowableRunnable configureAndComplete(String text) { @@ -478,7 +477,7 @@ ${(1..classMethodCount).collect({"void foo${it}() {}"}).join("\n")} "}" myFixture.configureByText('a.groovy', '') assert myFixture.file instanceof GroovyFile - PlatformTestUtil.startPerformanceTest('many siblings', 1000, { + PlatformTestUtil.startPerformanceTest('many siblings', { // clear caches WriteCommandAction.runWriteCommandAction(project) { myFixture.editor.document.text = "" @@ -522,7 +521,7 @@ public class Yoo$i implements Serializable, Cloneable, Hoo$i {} public class Doo$i {} """ } - PlatformTestUtil.startPerformanceTest("testing dfa", 800, { + PlatformTestUtil.startPerformanceTest("testing dfa", { myFixture.checkHighlighting true, false, false }).setup({ myFixture.enableInspections GroovyAssignabilityCheckInspection, UnusedDefInspection, GrUnusedIncDecInspection @@ -602,7 +601,7 @@ foo${n}(a) { foo${n - 1}(1) }""") def file = fixture.configureByText('_.groovy', builder.toString()) as GroovyFile - PlatformTestUtil.startPerformanceTest(getTestName(false), 2000, { + PlatformTestUtil.startPerformanceTest(getTestName(false), { myFixture.psiManager.dropPsiCaches() (file.methods.last().block.statements.last() as GrExpression).type }).attempts(5).assertTiming() @@ -610,7 +609,7 @@ foo${n}(a) { void 'test complex DFA with a lot of closures'() { fixture.configureByFile("stress/dfa.groovy") - PlatformTestUtil.startPerformanceTest(getTestName(false), 10000, { + PlatformTestUtil.startPerformanceTest(getTestName(false), { myFixture.psiManager.dropPsiCaches() myFixture.doHighlighting() }).attempts(10).assertTiming() diff --git a/plugins/htmltools/testSrc/com/intellij/htmltools/codeInsight/daemon/HtmlHighlightingPerformanceTest.java b/plugins/htmltools/testSrc/com/intellij/htmltools/codeInsight/daemon/HtmlHighlightingPerformanceTest.java index 21aa77be7cd6..c3bab637f75c 100644 --- a/plugins/htmltools/testSrc/com/intellij/htmltools/codeInsight/daemon/HtmlHighlightingPerformanceTest.java +++ b/plugins/htmltools/testSrc/com/intellij/htmltools/codeInsight/daemon/HtmlHighlightingPerformanceTest.java @@ -37,16 +37,14 @@ public class HtmlHighlightingPerformanceTest extends BasePlatformTestCase { public void testPerformance2() { myFixture.configureByFiles(getTestName(false) + ".html", "manual.css"); - PlatformTestUtil.startPerformanceTest("HTML Highlighting 2", 5_500, () -> doTest()) - .usesAllCPUCores() + PlatformTestUtil.startPerformanceTest("HTML Highlighting 2", () -> doTest()) .warmupIterations(1) .assertTiming(); } public void testPerformance() { myFixture.configureByFiles(getTestName(false) + ".html", "stylesheet.css"); - PlatformTestUtil.startPerformanceTest("HTML Highlighting", 8_000, () -> doTest()) - .usesAllCPUCores() + PlatformTestUtil.startPerformanceTest("HTML Highlighting", () -> doTest()) .warmupIterations(1) .assertTiming(); } diff --git a/plugins/java-decompiler/plugin/test/org/jetbrains/java/decompiler/IdeaDecompilerTest.kt b/plugins/java-decompiler/plugin/test/org/jetbrains/java/decompiler/IdeaDecompilerTest.kt index cbb40ece1421..631062f9278f 100644 --- a/plugins/java-decompiler/plugin/test/org/jetbrains/java/decompiler/IdeaDecompilerTest.kt +++ b/plugins/java-decompiler/plugin/test/org/jetbrains/java/decompiler/IdeaDecompilerTest.kt @@ -146,7 +146,7 @@ class IdeaDecompilerTest : LightJavaCodeInsightFixtureTestCase() { val jrt = JavaVersion.current().feature >= 9 val base = if (jrt) "jrt://${SystemProperties.getJavaHome()}!/java.desktop/" else "jar://${SystemProperties.getJavaHome()}/lib/rt.jar!/" val file = VirtualFileManager.getInstance().findFileByUrl(base + "javax/swing/JTable.class")!! - PlatformTestUtil.startPerformanceTest("decompiling JTable.class", 10000) { decompiler.getText(file) }.assertTiming() + PlatformTestUtil.startPerformanceTest("decompiling JTable.class") { decompiler.getText(file) }.assertTiming() } fun testStructureView() { diff --git a/plugins/java-i18n/testSrc/com/intellij/lang/properties/PropertiesPerformanceTest.java b/plugins/java-i18n/testSrc/com/intellij/lang/properties/PropertiesPerformanceTest.java index 057c70e8e984..74780e6ba5dd 100644 --- a/plugins/java-i18n/testSrc/com/intellij/lang/properties/PropertiesPerformanceTest.java +++ b/plugins/java-i18n/testSrc/com/intellij/lang/properties/PropertiesPerformanceTest.java @@ -44,7 +44,7 @@ public class PropertiesPerformanceTest extends JavaCodeInsightTestCase { public void testTypingInBigFile() throws Exception { configureByFile(getTestName(true) + "/File1.properties"); - PlatformTestUtil.startPerformanceTest(getTestName(false), 300, () -> { + PlatformTestUtil.startPerformanceTest(getTestName(false), () -> { type(' '); PsiDocumentManager.getInstance(myProject).commitDocument(myEditor.getDocument()); backspace(); @@ -55,7 +55,7 @@ public class PropertiesPerformanceTest extends JavaCodeInsightTestCase { public void testResolveManyLiterals() throws Exception { final PsiClass aClass = generateTestFiles(); assertNotNull(aClass); - PlatformTestUtil.startPerformanceTest(getTestName(false), 4000, () -> aClass.accept(new JavaRecursiveElementWalkingVisitor() { + PlatformTestUtil.startPerformanceTest(getTestName(false), () -> aClass.accept(new JavaRecursiveElementWalkingVisitor() { @Override public void visitLiteralExpression(@NotNull PsiLiteralExpression expression) { PsiReference[] references = expression.getReferences(); @@ -63,7 +63,7 @@ public class PropertiesPerformanceTest extends JavaCodeInsightTestCase { reference.resolve(); } } - })).useLegacyScaling().assertTiming(); + })).assertTiming(); } private PsiClass generateTestFiles() throws IOException { diff --git a/plugins/lombok/src/test/java/de/plushnikov/intellij/plugin/performance/PerformanceTest.java b/plugins/lombok/src/test/java/de/plushnikov/intellij/plugin/performance/PerformanceTest.java index a79af3fd25f1..fbd9d51abc3e 100644 --- a/plugins/lombok/src/test/java/de/plushnikov/intellij/plugin/performance/PerformanceTest.java +++ b/plugins/lombok/src/test/java/de/plushnikov/intellij/plugin/performance/PerformanceTest.java @@ -14,7 +14,7 @@ public class PerformanceTest extends AbstractLombokLightCodeInsightTestCase { final String testName = getTestName(true); loadToPsiFile("/performance/" + testName + "/lombok.config"); final PsiFile psiFile = loadToPsiFile("/performance/" + testName + "/HugeClass.java"); - PlatformTestUtil.startPerformanceTest(getTestName(false), 500, () -> { + PlatformTestUtil.startPerformanceTest(getTestName(false), () -> { type(' '); PsiDocumentManager.getInstance(getProject()).commitDocument(getEditor().getDocument()); ((PsiJavaFileImpl)psiFile).getClasses()[0].getFields()[0].hasModifierProperty(PsiModifier.FINAL); @@ -34,7 +34,7 @@ public class PerformanceTest extends AbstractLombokLightCodeInsightTestCase { } public void testGeneratedCode() { - PlatformTestUtil.startPerformanceTest("300 unrelated methods", 60000, () -> { + PlatformTestUtil.startPerformanceTest("300 unrelated methods", () -> { StringBuilder text = new StringBuilder("import lombok.Getter; import lombok.Setter; @interface Tolerate{} class Foo {"); for (int i = 0; i < 200; i++) { text.append("@Getter @Setter int bar").append(i).append(";"); @@ -57,7 +57,7 @@ public class PerformanceTest extends AbstractLombokLightCodeInsightTestCase { } public void testGeneratedCodeThroughStubs() { - PlatformTestUtil.startPerformanceTest("200 unrelated methods", 20000, () -> { + PlatformTestUtil.startPerformanceTest("200 unrelated methods", () -> { StringBuilder text = new StringBuilder("import lombok.Getter; import lombok.Setter; @interface Tolerate{} class Foo {"); for (int i = 0; i < 200; i++) { text.append("@Getter @Setter int bar").append(i).append(";"); @@ -101,7 +101,7 @@ public class PerformanceTest extends AbstractLombokLightCodeInsightTestCase { classText.append("}"); } - PlatformTestUtil.startPerformanceTest("@Data/@EqualsAndHashCode/@ToString performance", 30000, () -> { + PlatformTestUtil.startPerformanceTest("@Data/@EqualsAndHashCode/@ToString performance", () -> { myFixture.configureByText("Bar.java", classText.toString()); myFixture.checkHighlighting(); }) diff --git a/plugins/properties/tests/testSrc/com/intellij/lang/properties/PropertiesEnterTest.java b/plugins/properties/tests/testSrc/com/intellij/lang/properties/PropertiesEnterTest.java index 4178dce8aa46..a533fbb536ef 100644 --- a/plugins/properties/tests/testSrc/com/intellij/lang/properties/PropertiesEnterTest.java +++ b/plugins/properties/tests/testSrc/com/intellij/lang/properties/PropertiesEnterTest.java @@ -47,7 +47,7 @@ public class PropertiesEnterTest extends LightPlatformCodeInsightTestCase { String line = "some.relatively.long.property.name=And here's some property value for that really unique key, nice to have\n"; String text = StringUtil.repeat(line, 20000) + "\n" + StringUtil.repeat(line, 10000); configureFromFileText("performance.properties", text); - PlatformTestUtil.startPerformanceTest("Property files editing", 2500, () -> { + PlatformTestUtil.startPerformanceTest("Property files editing", () -> { type("aaaa=bbb"); PsiDocumentManager.getInstance(getProject()).commitAllDocuments(); }).assertTiming(); diff --git a/plugins/terminal/tests/org/jetbrains/plugins/terminal/block/BlockTerminalTest.kt b/plugins/terminal/tests/org/jetbrains/plugins/terminal/block/BlockTerminalTest.kt index d243142db72f..e6ffcfa69f5c 100644 --- a/plugins/terminal/tests/org/jetbrains/plugins/terminal/block/BlockTerminalTest.kt +++ b/plugins/terminal/tests/org/jetbrains/plugins/terminal/block/BlockTerminalTest.kt @@ -76,7 +76,7 @@ class BlockTerminalTest(private val shellPath: Path) { SimpleTextRepeater.Item("Done", false, true, 1)) setTerminalBufferMaxLines(items.sumOf { it.count }) val session = startBlockTerminalSession(TermSize(200, 100)) - PlatformTestUtil.startPerformanceTest("large output is read", 30000) { + PlatformTestUtil.startPerformanceTest("large output is read") { val outputFuture: CompletableFuture = getCommandResultFuture(session) session.sendCommandToExecuteWithoutAddingToHistory(SimpleTextRepeater.Helper.generateCommand(items)) assertCommandResult(0, SimpleTextRepeater.Helper.getExpectedOutput(items), outputFuture) diff --git a/plugins/xpath/xpath-lang/test/org/intellij/lang/xpath/XPathExpressionGeneratorTest.java b/plugins/xpath/xpath-lang/test/org/intellij/lang/xpath/XPathExpressionGeneratorTest.java index aaaa87ac9ae6..d8a418277eca 100644 --- a/plugins/xpath/xpath-lang/test/org/intellij/lang/xpath/XPathExpressionGeneratorTest.java +++ b/plugins/xpath/xpath-lang/test/org/intellij/lang/xpath/XPathExpressionGeneratorTest.java @@ -19,10 +19,9 @@ public class XPathExpressionGeneratorTest extends TestBase { } public void testManySiblings() { - PlatformTestUtil.startPerformanceTest("Many siblings", 15000, () -> { + PlatformTestUtil.startPerformanceTest("Many siblings", () -> { assertXPath("/stopWord/word", "/stopWord/word[2359]"); }) - .usesAllCPUCores() .assertTiming(); } diff --git a/plugins/yaml/testSrc/org/jetbrains/yaml/highlighting/YAMLIncompatibleTypesInspectionTest.kt b/plugins/yaml/testSrc/org/jetbrains/yaml/highlighting/YAMLIncompatibleTypesInspectionTest.kt index 8c112ae06074..b7d55ca77a86 100644 --- a/plugins/yaml/testSrc/org/jetbrains/yaml/highlighting/YAMLIncompatibleTypesInspectionTest.kt +++ b/plugins/yaml/testSrc/org/jetbrains/yaml/highlighting/YAMLIncompatibleTypesInspectionTest.kt @@ -158,7 +158,7 @@ class YAMLIncompatibleTypesInspectionTest : BasePlatformTestCase() { } - abc: true """.trimIndent()) - PlatformTestUtil.startPerformanceTest("Inspection should finish in sane time", 4000) { + PlatformTestUtil.startPerformanceTest("Inspection should finish in sane time") { myFixture.testHighlighting() }.warmupIterations(0).attempts(1).assertTiming() } diff --git a/plugins/yaml/testSrc/org/jetbrains/yaml/schema/YamlMultilineInjectionTest.kt b/plugins/yaml/testSrc/org/jetbrains/yaml/schema/YamlMultilineInjectionTest.kt index 09ae90fb982f..0fb34bcc4f12 100644 --- a/plugins/yaml/testSrc/org/jetbrains/yaml/schema/YamlMultilineInjectionTest.kt +++ b/plugins/yaml/testSrc/org/jetbrains/yaml/schema/YamlMultilineInjectionTest.kt @@ -1040,7 +1040,7 @@ abstract class AbstractYamlMultilineInjectionTest(val async: Boolean) : BasePlat val pos = myFixture.file.text.indexOf("key$half: val$half") + "key$half: val$half".length myFixture.editor.caretModel.moveToOffset(pos) myFixture.performEditorAction(IdeActions.ACTION_EDITOR_ENTER) - PlatformTestUtil.startPerformanceTest("Typing in injected", 24 * size * size) { + PlatformTestUtil.startPerformanceTest("Typing in injected") { for (i in 0..size) { myFixture.type("newkey$i: val$i") myFixture.performEditorAction(IdeActions.ACTION_EDITOR_ENTER) @@ -1071,7 +1071,7 @@ abstract class AbstractYamlMultilineInjectionTest(val async: Boolean) : BasePlat | |""".trimMargin()) - PlatformTestUtil.startPerformanceTest("Reformatting large", 30 * size) { + PlatformTestUtil.startPerformanceTest("Reformatting large") { myFixture.performEditorAction(IdeActions.ACTION_EDITOR_REFORMAT) }.attempts(1) .assertTiming() diff --git a/python/testSrc/com/jetbrains/python/PyOverloadsProcessingPerformanceTest.java b/python/testSrc/com/jetbrains/python/PyOverloadsProcessingPerformanceTest.java index 3b570d0939a9..3ad0471e2c28 100644 --- a/python/testSrc/com/jetbrains/python/PyOverloadsProcessingPerformanceTest.java +++ b/python/testSrc/com/jetbrains/python/PyOverloadsProcessingPerformanceTest.java @@ -66,7 +66,7 @@ public class PyOverloadsProcessingPerformanceTest extends PyTestCase { public void testComputingResultTypeWithCodeAnalysisContext() { PyCallExpression call = configureAndGetCallExprUnderCaret("mainQualified.py"); - doPerformanceTestResettingCaches("Computing result type with code analysis context", 1200, () -> { + doPerformanceTestResettingCaches("Computing result type with code analysis context", () -> { TypeEvalContext context = TypeEvalContext.codeAnalysis(myFixture.getProject(), myFixture.getFile()); assertType("int", call, context); }); @@ -74,7 +74,7 @@ public class PyOverloadsProcessingPerformanceTest extends PyTestCase { public void testComputingResultTypeWithUserInitiatedContext() { PyCallExpression call = configureAndGetCallExprUnderCaret("mainQualified.py"); - doPerformanceTestResettingCaches("Computing result type with user initiated context", 4000, () -> { + doPerformanceTestResettingCaches("Computing result type with user initiated context", () -> { TypeEvalContext context = TypeEvalContext.userInitiated(myFixture.getProject(), myFixture.getFile()); assertType("int", call, context); }); @@ -83,7 +83,7 @@ public class PyOverloadsProcessingPerformanceTest extends PyTestCase { public void testNavigatingToDefinition() { configureAndGetCallExprUnderCaret("mainQualified.py"); Project project = myFixture.getProject(); - doPerformanceTestResettingCaches("Navigating to definition", 600, () -> { + doPerformanceTestResettingCaches("Navigating to definition", () -> { TypeEvalContext context = TypeEvalContext.userInitiated(project, myFixture.getFile()); PsiElement target = GotoDeclarationAction.findTargetElement(project, myFixture.getEditor(), myFixture.getCaretOffset()); assertNotNull(target); @@ -98,7 +98,7 @@ public class PyOverloadsProcessingPerformanceTest extends PyTestCase { PsiElement leaf = myFixture.getFile().findElementAt(myFixture.getCaretOffset()); DocumentationManager docManager = DocumentationManager.getInstance(myFixture.getProject()); PsiElement docTarget = docManager.findTargetElement(myFixture.getEditor(), leaf.getTextOffset(), myFixture.getFile(), leaf); - doPerformanceTestResettingCaches("Rendering Quick Documentation", 100, () -> { + doPerformanceTestResettingCaches("Rendering Quick Documentation", () -> { String doc = docProvider.generateDoc(docTarget, leaf); // Smoke test that it's the right documentation. assertTrue(doc.contains("def func(x")); @@ -108,7 +108,7 @@ public class PyOverloadsProcessingPerformanceTest extends PyTestCase { public void testUnresolvedReferencesInspectionPass() { myFixture.copyDirectoryToProject("", ""); myFixture.enableInspections(PyUnresolvedReferencesInspection.class); - doPerformanceTestResettingCaches("Pass of Unresolved References inspection", 1200, () -> { + doPerformanceTestResettingCaches("Pass of Unresolved References inspection", () -> { myFixture.configureByFile("mainQualified.py"); myFixture.checkHighlighting(); }); @@ -117,7 +117,7 @@ public class PyOverloadsProcessingPerformanceTest extends PyTestCase { public void testArgumentListInspectionPass() { myFixture.copyDirectoryToProject("", ""); myFixture.enableInspections(PyArgumentListInspection.class); - doPerformanceTestResettingCaches("Pass of Incorrect Call Arguments inspection", 1200, () -> { + doPerformanceTestResettingCaches("Pass of Incorrect Call Arguments inspection", () -> { myFixture.configureByFile("mainQualified.py"); myFixture.checkHighlighting(); }); @@ -139,9 +139,9 @@ public class PyOverloadsProcessingPerformanceTest extends PyTestCase { assertEquals(NUMBER_OF_OVERLOADS, resolveResults.length); } - private void doPerformanceTestResettingCaches(@NotNull String text, int expectedMs, ThrowableRunnable runnable) { + private void doPerformanceTestResettingCaches(@NotNull String text, ThrowableRunnable runnable) { PsiManager psiManager = myFixture.getPsiManager(); - PlatformTestUtil.startPerformanceTest(text, expectedMs, runnable) + PlatformTestUtil.startPerformanceTest(text, runnable) .setup(() -> { psiManager.dropPsiCaches(); psiManager.dropResolveCaches(); diff --git a/spellchecker/testSrc/com/intellij/spellchecker/dataset/DataSetPerformanceTest.kt b/spellchecker/testSrc/com/intellij/spellchecker/dataset/DataSetPerformanceTest.kt index 57f8bcc41503..0fe6340fcc7d 100644 --- a/spellchecker/testSrc/com/intellij/spellchecker/dataset/DataSetPerformanceTest.kt +++ b/spellchecker/testSrc/com/intellij/spellchecker/dataset/DataSetPerformanceTest.kt @@ -12,7 +12,7 @@ class DataSetPerformanceTest: SpellcheckerInspectionTestCase() { val manager = SpellCheckerManager.getInstance(project) val total = Datasets.missp.flatMap { it.misspellings + it.word }.size - PlatformTestUtil.startPerformanceTest("highlight ${total} words in missp", 1750) { + PlatformTestUtil.startPerformanceTest("highlight ${total} words in missp") { for (word in Datasets.missp) { manager.hasProblem(word.word) for (missp in word.misspellings) { @@ -26,7 +26,7 @@ class DataSetPerformanceTest: SpellcheckerInspectionTestCase() { val manager = SpellCheckerManager.getInstance(project) val total = Datasets.words.flatMap { it.misspellings + it.word }.size - PlatformTestUtil.startPerformanceTest("highlight ${total} words in words", 200) { + PlatformTestUtil.startPerformanceTest("highlight ${total} words in words") { for (word in Datasets.words) { manager.hasProblem(word.word) for (missp in word.misspellings) { @@ -41,7 +41,7 @@ class DataSetPerformanceTest: SpellcheckerInspectionTestCase() { val manager = SpellCheckerManager.getInstance(project) val total = Datasets.wordsCamelCase.flatMap { it.misspellings + it.word }.size - PlatformTestUtil.startPerformanceTest("highlight ${total} words in camel-case", 500) { + PlatformTestUtil.startPerformanceTest("highlight ${total} words in camel-case") { for (word in Datasets.wordsCamelCase) { manager.hasProblem(word.word) for (missp in word.misspellings) { diff --git a/spellchecker/testSrc/com/intellij/spellchecker/inspection/SpellcheckerPerformanceTest.java b/spellchecker/testSrc/com/intellij/spellchecker/inspection/SpellcheckerPerformanceTest.java index de1f28008c65..760f6c6a5ddb 100644 --- a/spellchecker/testSrc/com/intellij/spellchecker/inspection/SpellcheckerPerformanceTest.java +++ b/spellchecker/testSrc/com/intellij/spellchecker/inspection/SpellcheckerPerformanceTest.java @@ -57,7 +57,7 @@ public class SpellcheckerPerformanceTest extends SpellcheckerInspectionTestCase DaemonCodeAnalyzer.getInstance(getProject()).restart(); int[] toIgnore = ignoreEverythingExceptInspections(); - PlatformTestUtil.startPerformanceTest("many typos highlighting", 12_000, () -> { + PlatformTestUtil.startPerformanceTest("many typos highlighting", () -> { assertSize(typoCount, CodeInsightTestFixtureImpl.instantiateAndRun(myFixture.getFile(), myFixture.getEditor(), toIgnore, false)); }).assertTiming(); } @@ -79,7 +79,7 @@ public class SpellcheckerPerformanceTest extends SpellcheckerInspectionTestCase assertEmpty(infos); LOG.debug("warm-up took " + (System.currentTimeMillis() - start) + " ms"); - PlatformTestUtil.startPerformanceTest("many whitespaces highlighting", 4500, () -> { + PlatformTestUtil.startPerformanceTest("many whitespaces highlighting", () -> { DaemonCodeAnalyzer.getInstance(getProject()).restart(); assertEmpty(runLocalInspections()); }).assertTiming(); @@ -87,43 +87,43 @@ public class SpellcheckerPerformanceTest extends SpellcheckerInspectionTestCase public void testVeryLongEmail() { final String text = "\\LONG_EMAIL: " + StringUtil.repeat("ivan.ivanov", 1000000) + "@mail.com\n"; - doSplitterPerformanceTest(text, CommentSplitter.getInstance(), 8000); + doSplitterPerformanceTest(text, CommentSplitter.getInstance()); } public void testVeryLongURL() { final String text = "\\LONG_URL: http://" + StringUtil.repeat("ivan.ivanov", 1000000) + ".com\n"; - doSplitterPerformanceTest(text, CommentSplitter.getInstance(), 8000); + doSplitterPerformanceTest(text, CommentSplitter.getInstance()); } public void testVeryLongHTML() { final String text = "\\ LONG_HTML "; - doSplitterPerformanceTest(text, CommentSplitter.getInstance(), 5000); + doSplitterPerformanceTest(text, CommentSplitter.getInstance()); } public void testVeryLongIdentifier() { final String text = StringUtil.repeat("identifier1", 1000000); - doSplitterPerformanceTest(text, IdentifierSplitter.getInstance(), 3000); + doSplitterPerformanceTest(text, IdentifierSplitter.getInstance()); } public void testVeryLongSpecialCharacters() { final String text = "word" + StringUtil.repeat("\n\t\r\t\n", 1000000); - doSplitterPerformanceTest(text, TextSplitter.getInstance(), 2000); + doSplitterPerformanceTest(text, TextSplitter.getInstance()); } public void testVeryLongProperty() { final String text = StringUtil.repeat("properties.test.properties", 1000000); - doSplitterPerformanceTest(text, PropertiesSplitter.getInstance(), 4000); + doSplitterPerformanceTest(text, PropertiesSplitter.getInstance()); } public void testVeryLongList() { final String text = StringUtil.repeat("properties,test,properties", 1000000); - doSplitterPerformanceTest(text, PlainTextSplitter.getInstance(), 3000); + doSplitterPerformanceTest(text, PlainTextSplitter.getInstance()); } - private static void doSplitterPerformanceTest(String text, Splitter splitter, int expectedTime) { - PlatformTestUtil.startPerformanceTest("long word for spelling", expectedTime, () -> { + private static void doSplitterPerformanceTest(String text, Splitter splitter) { + PlatformTestUtil.startPerformanceTest("long word for spelling", () -> { try { splitter.split(text, TextRange.allOf(text), (textRange) -> {}); } diff --git a/tools/intellij.tools.ide.metrics.benchmark/testSrc/com/intellij/tools/ide/metrics/benchmark/SpanExtractionFromUnitPerfTest.kt b/tools/intellij.tools.ide.metrics.benchmark/testSrc/com/intellij/tools/ide/metrics/benchmark/SpanExtractionFromUnitPerfTest.kt index 040b85edca26..39bb7bca1563 100644 --- a/tools/intellij.tools.ide.metrics.benchmark/testSrc/com/intellij/tools/ide/metrics/benchmark/SpanExtractionFromUnitPerfTest.kt +++ b/tools/intellij.tools.ide.metrics.benchmark/testSrc/com/intellij/tools/ide/metrics/benchmark/SpanExtractionFromUnitPerfTest.kt @@ -102,7 +102,7 @@ class SpanExtractionFromUnitPerfTest { @Test fun flushingTelemetryMetricsShouldNotFailTheTest() { val spanName = "simple perf test" - PlatformTestUtil.startPerformanceTest(spanName, 100) { + PlatformTestUtil.startPerformanceTest(spanName) { runBlocking { delay(Random.nextInt(100, 500).milliseconds) } }.assertTiming() checkMetricsAreFlushedToTelemetryFile(spanName) @@ -112,7 +112,7 @@ class SpanExtractionFromUnitPerfTest { fun throwingExceptionWillNotAffectMetricsPublishing() { val spanName = "perf test throwing exception" try { - PlatformTestUtil.startPerformanceTest(spanName, 100) { + PlatformTestUtil.startPerformanceTest(spanName) { runBlocking { delay(Random.nextInt(100, 500).milliseconds) } throw RuntimeException("Exception text") }.warmupIterations(0).assertTiming() diff --git a/uast/uast-tests/test/org/jetbrains/uast/test/java/JavaUastPerformanceTest.kt b/uast/uast-tests/test/org/jetbrains/uast/test/java/JavaUastPerformanceTest.kt index 42d726eeb6dd..25afff338ba1 100644 --- a/uast/uast-tests/test/org/jetbrains/uast/test/java/JavaUastPerformanceTest.kt +++ b/uast/uast-tests/test/org/jetbrains/uast/test/java/JavaUastPerformanceTest.kt @@ -46,7 +46,7 @@ class JavaUastPerformanceTest : AbstractJavaUastTest() { } } """.trimIndent()) - PlatformTestUtil.startPerformanceTest("convert each element to uast first time", 1000) { + PlatformTestUtil.startPerformanceTest("convert each element to uast first time") { val walker = EachPsiToUastWalker() clazz.accept(walker) TestCase.assertEquals(4019, walker.totalCount) @@ -56,7 +56,7 @@ class JavaUastPerformanceTest : AbstractJavaUastTest() { @Test fun testConvertAllElementsWithNaiveToUElement() { myFixture.configureByFile("Performance/Thinlet.java") - PlatformTestUtil.startPerformanceTest(getTestName(false), 13_000, object : ThrowableRunnable { + PlatformTestUtil.startPerformanceTest(getTestName(false), object : ThrowableRunnable { var hash = 0 override fun run() { for (i in 0..99) { diff --git a/uast/uast-tests/test/org/jetbrains/uast/test/java/analysis/UStringEvaluatorTest.kt b/uast/uast-tests/test/org/jetbrains/uast/test/java/analysis/UStringEvaluatorTest.kt index 5cbb98e35e01..427b0b7b2a42 100644 --- a/uast/uast-tests/test/org/jetbrains/uast/test/java/analysis/UStringEvaluatorTest.kt +++ b/uast/uast-tests/test/org/jetbrains/uast/test/java/analysis/UStringEvaluatorTest.kt @@ -12,8 +12,11 @@ import com.intellij.psi.util.StringEntry import com.intellij.testFramework.PlatformTestUtil import com.intellij.util.asSafely import junit.framework.TestCase -import org.jetbrains.uast.* +import org.jetbrains.uast.UCallExpression +import org.jetbrains.uast.UExpressionList +import org.jetbrains.uast.ULiteralExpression import org.jetbrains.uast.analysis.* +import org.jetbrains.uast.toUElement class UStringEvaluatorTest : AbstractStringEvaluatorTest() { fun `test simple string`() = doTest( @@ -478,7 +481,7 @@ class UStringEvaluatorTest : AbstractStringEvaluatorTest() { myFixture.doHighlighting() val expected = "'a'${"{'a'|'b'}".repeat(updateTimes + 1)}" - PlatformTestUtil.startPerformanceTest("calculate value of many assignments", 1000) { + PlatformTestUtil.startPerformanceTest("calculate value of many assignments") { val pks = UStringEvaluator().calculateValue(elementAtCaret, UNeDfaConfiguration( methodCallDepth = 2, methodsToAnalyzePattern = psiMethod().withName("b") diff --git a/uast/uast-tests/test/org/jetbrains/uast/test/java/analysis/UStringEvaluatorWithSideEffectsTest.kt b/uast/uast-tests/test/org/jetbrains/uast/test/java/analysis/UStringEvaluatorWithSideEffectsTest.kt index a144c6ffcb7e..6f719b8b0683 100644 --- a/uast/uast-tests/test/org/jetbrains/uast/test/java/analysis/UStringEvaluatorWithSideEffectsTest.kt +++ b/uast/uast-tests/test/org/jetbrains/uast/test/java/analysis/UStringEvaluatorWithSideEffectsTest.kt @@ -513,7 +513,7 @@ class UStringEvaluatorWithSideEffectsTest : AbstractStringEvaluatorTest() { ?: fail("Cannot find UElement at caret") val expected = "'a''b'".repeat(size) - PlatformTestUtil.startPerformanceTest("calculate value of many assignments", 1000) { + PlatformTestUtil.startPerformanceTest("calculate value of many assignments") { val pks = UStringEvaluator().calculateValue(elementAtCaret, UNeDfaConfiguration( methodCallDepth = 2, methodsToAnalyzePattern = PsiJavaPatterns.psiMethod().withName("b"), diff --git a/xml/dom-tests/tests/com/intellij/util/xml/DomPerformanceTest.java b/xml/dom-tests/tests/com/intellij/util/xml/DomPerformanceTest.java index c9ae3091e2f3..d0f5641fbc4b 100644 --- a/xml/dom-tests/tests/com/intellij/util/xml/DomPerformanceTest.java +++ b/xml/dom-tests/tests/com/intellij/util/xml/DomPerformanceTest.java @@ -37,7 +37,7 @@ public class DomPerformanceTest extends DomHardCoreTestCase { public void testVisitorPerformance() { Ref ref = new Ref<>(); - PlatformTestUtil.startPerformanceTest("creating", 40_000, () -> ApplicationManager.getApplication().runWriteAction(() -> { + PlatformTestUtil.startPerformanceTest("creating", () -> ApplicationManager.getApplication().runWriteAction(() -> { MyElement element = createElement("", MyElement.class); MyElement child = element.addChildElement(); child.getAttr().setValue("239"); @@ -58,7 +58,7 @@ public class DomPerformanceTest extends DomHardCoreTestCase { MyElement newElement = createElement(DomUtil.getFile(ref.get()).getText(), MyElement.class); - PlatformTestUtil.startPerformanceTest("visiting", 450, () -> + PlatformTestUtil.startPerformanceTest("visiting", () -> newElement.acceptChildren(new DomElementVisitor() { @Override public void visitDomElement(DomElement element) { @@ -99,7 +99,7 @@ public class DomPerformanceTest extends DomHardCoreTestCase { final XmlFile file = (XmlFile)getPsiManager().findFile(virtualFile); assertFalse(file.getNode().isParsed()); assertTrue(StringUtil.isNotEmpty(file.getText())); - PlatformTestUtil.startPerformanceTest("DOM parsing", 10, () -> assertNull(getDomManager().getFileElement(file))).assertTiming(); + PlatformTestUtil.startPerformanceTest("DOM parsing", () -> assertNull(getDomManager().getFileElement(file))).assertTiming(); } public void testDontParseNamespacedDomFiles() throws Exception { diff --git a/xml/tests/src/com/intellij/codeInsight/XmlPerformanceTest.java b/xml/tests/src/com/intellij/codeInsight/XmlPerformanceTest.java index 9e2579410b09..8215971e6793 100644 --- a/xml/tests/src/com/intellij/codeInsight/XmlPerformanceTest.java +++ b/xml/tests/src/com/intellij/codeInsight/XmlPerformanceTest.java @@ -52,13 +52,13 @@ public class XmlPerformanceTest extends LightQuickFixTestCase { doHighlighting(); getEditor().getSelectionModel().setSelection(0, getEditor().getDocument().getTextLength()); - PlatformTestUtil.startPerformanceTest("indent/unindent "+time, time, () -> { + PlatformTestUtil.startPerformanceTest("indent/unindent "+time, () -> { EditorActionManager.getInstance().getActionHandler("EditorIndentSelection").execute(getEditor(), null, DataManager.getInstance().getDataContext()); EditorActionManager.getInstance().getActionHandler("EditorUnindentSelection").execute(getEditor(), null, DataManager.getInstance().getDataContext()); - }).useLegacyScaling().assertTiming(); + }).assertTiming(); final int startOffset = getEditor().getCaretModel().getOffset(); getEditor().getSelectionModel().setSelection(startOffset, startOffset); checkResultByFile(getBasePath() + getTestName(false)+".xml"); diff --git a/xml/tests/src/com/intellij/codeInsight/daemon/XmlHighlightingTest.java b/xml/tests/src/com/intellij/codeInsight/daemon/XmlHighlightingTest.java index 6c71fe794d29..d8e81bcd4b32 100644 --- a/xml/tests/src/com/intellij/codeInsight/daemon/XmlHighlightingTest.java +++ b/xml/tests/src/com/intellij/codeInsight/daemon/XmlHighlightingTest.java @@ -1240,9 +1240,8 @@ public class XmlHighlightingTest extends DaemonAnalyzerTestCase { "]>\n" + ""); PlatformTestUtil - .startPerformanceTest("highlighting", 4_500, () -> doHighlighting()) + .startPerformanceTest("highlighting", () -> doHighlighting()) .setup(() -> getPsiManager().dropPsiCaches()) - .usesAllCPUCores() .assertTiming(); } diff --git a/xml/tests/src/com/intellij/codeInsight/template/emmet/HtmlEmmetPerformanceTest.java b/xml/tests/src/com/intellij/codeInsight/template/emmet/HtmlEmmetPerformanceTest.java index 9af31624d803..c7f0abc9a0ff 100644 --- a/xml/tests/src/com/intellij/codeInsight/template/emmet/HtmlEmmetPerformanceTest.java +++ b/xml/tests/src/com/intellij/codeInsight/template/emmet/HtmlEmmetPerformanceTest.java @@ -22,7 +22,7 @@ import java.nio.charset.StandardCharsets; public class HtmlEmmetPerformanceTest extends BasePlatformTestCase { public void testPerformance() throws Exception { final String fileContent = FileUtil.loadFile(new File(getTestDataPath() + "/performance.html"), StandardCharsets.UTF_8); - PlatformTestUtil.startPerformanceTest(getTestName(true), 3000, () -> { + PlatformTestUtil.startPerformanceTest(getTestName(true), () -> { for (int i = 0; i < 50; i++) { myFixture.configureByText(HtmlFileType.INSTANCE, fileContent); PsiDocumentManager.getInstance(myFixture.getProject()).commitDocument(myFixture.getDocument(myFixture.getFile())); @@ -32,7 +32,7 @@ public class HtmlEmmetPerformanceTest extends BasePlatformTestCase { NonBlockingReadActionImpl.waitForAsyncTaskCompletion(); UIUtil.dispatchAllInvocationEvents(); } - }).useLegacyScaling().assertTiming(); + }).assertTiming(); myFixture.checkResultByFile("performance_after.html"); } diff --git a/xml/tests/src/com/intellij/editor/XmlEditorTest.java b/xml/tests/src/com/intellij/editor/XmlEditorTest.java index 1bfabf775044..015e15765558 100644 --- a/xml/tests/src/com/intellij/editor/XmlEditorTest.java +++ b/xml/tests/src/com/intellij/editor/XmlEditorTest.java @@ -34,7 +34,7 @@ public class XmlEditorTest extends LightJavaCodeInsightTestCase { for (int i = 0; i < 3; i++) { EditorTestUtil.performTypingAction(getEditor(), '\n'); } - PlatformTestUtil.startPerformanceTest("Xml editor enter", 5000, () -> { + PlatformTestUtil.startPerformanceTest("Xml editor enter", () -> { for (int i = 0; i < 3; i ++) { EditorTestUtil.performTypingAction(getEditor(), '\n'); } diff --git a/xml/tests/src/com/intellij/psi/formatter/XmlPerformanceFormatterTest.java b/xml/tests/src/com/intellij/psi/formatter/XmlPerformanceFormatterTest.java index d3bd21617543..80e723fa32fc 100644 --- a/xml/tests/src/com/intellij/psi/formatter/XmlPerformanceFormatterTest.java +++ b/xml/tests/src/com/intellij/psi/formatter/XmlPerformanceFormatterTest.java @@ -42,14 +42,14 @@ public class XmlPerformanceFormatterTest extends XmlFormatterTestBase { } public void testReformatCodeFragment() { - PlatformTestUtil.startPerformanceTest("reformat code fragment", 6300, - () -> checkFormattingDoesNotProduceException("performance")).useLegacyScaling().assertTiming(); + PlatformTestUtil.startPerformanceTest("reformat code fragment", + () -> checkFormattingDoesNotProduceException("performance")).assertTiming(); } public void testPerformance3() { final FileEditorManager editorManager = FileEditorManager.getInstance(getProject()); try { - PlatformTestUtil.startPerformanceTest("xml formatter", 6800, createTestRunnable()).useLegacyScaling().assertTiming(); + PlatformTestUtil.startPerformanceTest("xml formatter", createTestRunnable()).assertTiming(); highlight(); @@ -86,7 +86,7 @@ public class XmlPerformanceFormatterTest extends XmlFormatterTestBase { public void testPerformance4() { final FileEditorManager editorManager = FileEditorManager.getInstance(getProject()); try { - PlatformTestUtil.startPerformanceTest("xml formatter", 20000, createTestRunnable()).useLegacyScaling().assertTiming(); + PlatformTestUtil.startPerformanceTest("xml formatter", createTestRunnable()).assertTiming(); } finally { editorManager.closeFile(editorManager.getSelectedFiles()[0]); @@ -107,7 +107,7 @@ public class XmlPerformanceFormatterTest extends XmlFormatterTestBase { public void testPerformance5() { final FileEditorManager editorManager = FileEditorManager.getInstance(getProject()); try { - PlatformTestUtil.startPerformanceTest("xml formatter", 10000, createTestRunnable()).useLegacyScaling().assertTiming(); + PlatformTestUtil.startPerformanceTest("xml formatter", createTestRunnable()).assertTiming(); } finally { final VirtualFile[] selectedFiles = editorManager.getSelectedFiles(); @@ -120,7 +120,7 @@ public class XmlPerformanceFormatterTest extends XmlFormatterTestBase { public void testPerformance6() { final FileEditorManager editorManager = FileEditorManager.getInstance(getProject()); try { - PlatformTestUtil.startPerformanceTest("xml formatter", 20000, createTestRunnable()).useLegacyScaling().assertTiming(); + PlatformTestUtil.startPerformanceTest("xml formatter", createTestRunnable()).assertTiming(); } finally { final VirtualFile[] selectedFiles = editorManager.getSelectedFiles(); @@ -129,7 +129,7 @@ public class XmlPerformanceFormatterTest extends XmlFormatterTestBase { } public void testPerformance7() { - PlatformTestUtil.startPerformanceTest("xml formatter", 3_000, createTestRunnable()).assertTiming(); + PlatformTestUtil.startPerformanceTest("xml formatter", createTestRunnable()).assertTiming(); } public void testPerformance() throws Exception { @@ -143,7 +143,7 @@ public class XmlPerformanceFormatterTest extends XmlFormatterTestBase { public void testPerformanceIdea148943() throws Exception { final String textBefore = loadFile(getTestName(true) + ".xml", null); final PsiFile file = createFileFromText(textBefore, "before.xml", PsiFileFactory.getInstance(getProject())); - PlatformTestUtil.startPerformanceTest("IDEA-148943", 20000, createAdjustLineIndentInRangeRunnable(file)) + PlatformTestUtil.startPerformanceTest("IDEA-148943", createAdjustLineIndentInRangeRunnable(file)) .assertTiming(); } diff --git a/xml/tests/src/com/intellij/psi/html/HtmlParseTest.java b/xml/tests/src/com/intellij/psi/html/HtmlParseTest.java index f3c863c72ff4..524eec461ec3 100644 --- a/xml/tests/src/com/intellij/psi/html/HtmlParseTest.java +++ b/xml/tests/src/com/intellij/psi/html/HtmlParseTest.java @@ -523,7 +523,7 @@ public class HtmlParseTest extends LightIdeaTestCase { ExtensionTestUtil.maskExtensions(ExtensionPointName.create("com.intellij.html.scriptContentProvider"), ContainerUtil.emptyList(), getTestRootDisposable()); final Ref result = Ref.create(); - PlatformTestUtil.startPerformanceTest("Parsing", 500, () -> result.set(getTreeTextByFile("index-all.html"))).assertTiming(); + PlatformTestUtil.startPerformanceTest("Parsing", () -> result.set(getTreeTextByFile("index-all.html"))).assertTiming(); assertResult("Performance.txt", result.get()); } diff --git a/xml/tests/src/com/intellij/xml/XmlLexerTest.java b/xml/tests/src/com/intellij/xml/XmlLexerTest.java index 3b04d0ad05de..5c1569c7a42b 100644 --- a/xml/tests/src/com/intellij/xml/XmlLexerTest.java +++ b/xml/tests/src/com/intellij/xml/XmlLexerTest.java @@ -47,14 +47,14 @@ public class XmlLexerTest extends LexerTestCase { public void testPerformance1() throws IOException { - doTestPerformance("pallada.xml", 200); + doTestPerformance("pallada.xml"); } public void testPerformance2() throws IOException { - doTestPerformance("performance2.xml", 400); + doTestPerformance("performance2.xml"); } - private static void doTestPerformance(String fileName, int expectedMs) throws IOException { + private static void doTestPerformance(String fileName) throws IOException { final String text = ParsingTestCase.loadFileDefault( PlatformTestUtil.getCommunityPath().replace(File.separatorChar, '/') + "/xml/tests/testData/psi/xml", fileName); @@ -62,7 +62,7 @@ public class XmlLexerTest extends LexerTestCase { final FilterLexer filterLexer = new FilterLexer(new XmlLexer(), new FilterLexer.SetFilter(new XMLParserDefinition().getWhitespaceTokens())); - PlatformTestUtil.startPerformanceTest("XML Lexer Performance on " + fileName, expectedMs, () -> { + PlatformTestUtil.startPerformanceTest("XML Lexer Performance on " + fileName, () -> { for (int i = 0; i < 10; i++) { doLex(lexer, text); doLex(filterLexer, text); diff --git a/xml/tests/src/com/intellij/xml/XmlNamespacesTest.java b/xml/tests/src/com/intellij/xml/XmlNamespacesTest.java index 2c6b79440dc7..7ab060c4d3e7 100644 --- a/xml/tests/src/com/intellij/xml/XmlNamespacesTest.java +++ b/xml/tests/src/com/intellij/xml/XmlNamespacesTest.java @@ -301,7 +301,7 @@ public class XmlNamespacesTest extends LightJavaCodeInsightFixtureTestCase { public void testPatternPerformanceProblem() { myFixture.configureByFile("idproblem.html"); - PlatformTestUtil.startPerformanceTest(getTestName(false), 100, () -> myFixture.doHighlighting()).assertTiming(); + PlatformTestUtil.startPerformanceTest(getTestName(false), () -> myFixture.doHighlighting()).assertTiming(); } private void doUnusedDeclarationTest(String text, String after, String name) { diff --git a/xml/tests/src/com/intellij/xml/XmlParsingAdditionalTest.java b/xml/tests/src/com/intellij/xml/XmlParsingAdditionalTest.java index 9063114a46ce..568ca28a771c 100644 --- a/xml/tests/src/com/intellij/xml/XmlParsingAdditionalTest.java +++ b/xml/tests/src/com/intellij/xml/XmlParsingAdditionalTest.java @@ -42,7 +42,7 @@ public class XmlParsingAdditionalTest extends BasePlatformTestCase { assertNotNull(doc); WriteCommandAction.writeCommandAction(project, file).run( - () -> PlatformTestUtil.startPerformanceTest("XML reparse using PsiBuilder", 2500, () -> { + () -> PlatformTestUtil.startPerformanceTest("XML reparse using PsiBuilder", () -> { for (int i = 0; i < 10; i++) { final long start = System.nanoTime(); doc.insertString(0, ""); diff --git a/xml/tests/src/com/intellij/xml/XmlParsingTest.java b/xml/tests/src/com/intellij/xml/XmlParsingTest.java index df2a3d566264..64f3086582ad 100644 --- a/xml/tests/src/com/intellij/xml/XmlParsingTest.java +++ b/xml/tests/src/com/intellij/xml/XmlParsingTest.java @@ -181,21 +181,21 @@ public class XmlParsingTest extends ParsingTestCase { public void testPerformance1() throws Exception { //noinspection SpellCheckingInspection - doTestPerformance("pallada.xml", 1000); + doTestPerformance("pallada.xml"); } public void testPerformance2() throws Exception { - doTestPerformance("performance2.xml", 2000); + doTestPerformance("performance2.xml"); } - private void doTestPerformance(String fileName, int expectedMs) throws IOException { + private void doTestPerformance(String fileName) throws IOException { final String text = loadFileDefault(getXmlParsingTestDataPath() + "psi/xml", fileName); long start = System.nanoTime(); final PsiFile file = createFile(fileName, text); transformAllChildren(file.getNode()); LOG.debug("First parsing took " + (System.nanoTime() - start) + "ns"); - PlatformTestUtil.startPerformanceTest("XML Parser Performance on " + fileName, expectedMs, () -> { + PlatformTestUtil.startPerformanceTest("XML Parser Performance on " + fileName, () -> { for (int i = 0; i < 10; i++) { PsiFile next = createPsiFile("test" + i, text); transformAllChildren(next.getNode());