From ccb197644761190014516c5d0e21d25fa7b970ae Mon Sep 17 00:00:00 2001 From: peter Date: Wed, 24 Jan 2018 17:30:05 +0100 Subject: [PATCH] set some performance test expectations to their current timings on a quad-core machine old expectations for single-core HT can't be scaled up --- .../daemon/LightAdvHighlightingPerformanceTest.java | 6 +++--- .../application/impl/ApplicationImplTest.java | 2 +- .../openapi/fileTypes/impl/FileTypesTest.java | 2 +- .../openapi/util/io/FileUtilPerformanceTest.java | 2 +- .../openapi/vfs/ArchiveFileSystemPerformanceTest.kt | 2 +- .../groovy/lang/GroovyStressPerformanceTest.groovy | 12 ++++++------ .../inspection/SpellcheckerPerformanceTest.java | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) 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 0e20e5c63708..64b193e2958b 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 @@ -125,7 +125,7 @@ public class LightAdvHighlightingPerformanceTest extends LightDaemonAnalyzerTest } public void testAThinlet() { - List errors = doTest(2000); + List errors = doTest(8_000); if (1170 != errors.size()) { doTest(getFilePath("_hl"), false, false); fail("Actual: " + errors.size()); @@ -133,7 +133,7 @@ public class LightAdvHighlightingPerformanceTest extends LightDaemonAnalyzerTest } public void testAClassLoader() { - List errors = doTest(150); + List errors = doTest(800); if (92 != errors.size()) { doTest(getFilePath("_hl"), false, false); fail("Actual: " + errors.size()); @@ -148,7 +148,7 @@ public class LightAdvHighlightingPerformanceTest extends LightDaemonAnalyzerTest text.append("}"); configureFromFileText("x.java", text.toString()); - List infos = startTest(800); + List infos = startTest(2_500); assertEmpty(infos); } } \ No newline at end of file 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 06b6c6b1a9aa..ff88df64527b 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 @@ -513,7 +513,7 @@ public class ApplicationImplTest extends LightPlatformTestCase { } //System.out.println("warming finished"); final int readIterations = 100_000_000; - PlatformTestUtil.startPerformanceTest("RWLock/unlock", 1500, ()-> { + PlatformTestUtil.startPerformanceTest("RWLock/unlock", 13_000, ()-> { ReadMostlyRWLock lock = new ReadMostlyRWLock(Thread.currentThread()); final int numOfThreads = JobSchedulerImpl.getJobPoolParallelism(); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/fileTypes/impl/FileTypesTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/fileTypes/impl/FileTypesTest.java index 83cd1ffe9799..521a50a34f6f 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/fileTypes/impl/FileTypesTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/fileTypes/impl/FileTypesTest.java @@ -109,7 +109,7 @@ public class FileTypesTest extends PlatformTestCase { String name = String.valueOf(i % 10 * 10 + i * 100 + i + 1); names[i] = name + name + name + name; } - PlatformTestUtil.startPerformanceTest("isFileIgnored", 15_000, () -> { + PlatformTestUtil.startPerformanceTest("isFileIgnored", 17_000, () -> { for (int i = 0; i < 100_000; i++) { for (String name : names) { myFileTypeManager.isFileIgnored(name); 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 a2a8f93e054a..12734067716f 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 @@ -30,7 +30,7 @@ public class FileUtilPerformanceTest { public void toCanonicalPath() { assertEquals(myCanonicalPath, FileUtil.toCanonicalPath(myTestPath)); - PlatformTestUtil.startPerformanceTest("toCanonicalPath", 650, () -> { + PlatformTestUtil.startPerformanceTest("toCanonicalPath", 1_000, () -> { for (int i = 0; i < 1000000; ++i) { final String canonicalPath = FileUtil.toCanonicalPath(myTestPath, '/'); assert canonicalPath != null && canonicalPath.length() == 18 : canonicalPath; 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 ff32f1e14f1d..462dfc6fb2a7 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/ArchiveFileSystemPerformanceTest.kt +++ b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/ArchiveFileSystemPerformanceTest.kt @@ -42,7 +42,7 @@ class ArchiveFileSystemPerformanceTest : BareTestFixtureTestCase() { @Test fun getLocalByEntry() { val local = fs.getLocalByEntry(entry)!! - PlatformTestUtil.startPerformanceTest("ArchiveFileSystem.getLocalByEntry()", 20, { + PlatformTestUtil.startPerformanceTest("ArchiveFileSystem.getLocalByEntry()", 30, { for (i in 0..100000) { assertEquals(local, fs.getLocalByEntry(entry)) } 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 19a9314b0419..c782e79ed121 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/GroovyStressPerformanceTest.groovy +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/GroovyStressPerformanceTest.groovy @@ -178,7 +178,7 @@ class GroovyStressPerformanceTest extends LightGroovyTestCase { } myFixture.enableInspections(new MissingReturnInspection()) - measureHighlighting("def void foo(T t, Closure cl) {}\n$text", 1000) + measureHighlighting("def void foo(T t, Closure cl) {}\n$text", 1600) } void testDeeplyNestedClosuresInGenericCalls2() { @@ -188,7 +188,7 @@ class GroovyStressPerformanceTest extends LightGroovyTestCase { text = "foo(it) { $text }" } myFixture.enableInspections(new MissingReturnInspection()) - measureHighlighting("def void foo(T t, Closure cl) {}\n$text", 1000) + measureHighlighting("def void foo(T t, Closure cl) {}\n$text", 1200) } void testManyAnnotatedScriptVariables() { @@ -255,13 +255,13 @@ class SomeClass { void someMethod(String s) {} } """ - measureHighlighting(text, 8000) + measureHighlighting(text, 14_000) } void "test infer only the variable types that are needed"() { addGdsl '''contribute(currentType(String.name)) { println 'sleeping' - Thread.sleep(1000) + Thread.sleep(100_000) method name:'foo', type:String, params:[:], namedParams:[ parameter(name:'param1', type:String), ] @@ -274,7 +274,7 @@ while (true) { f.canoPath } ''' - PlatformTestUtil.startPerformanceTest(getTestName(false), 80, configureAndComplete(text)).usesAllCPUCores().assertTiming() + PlatformTestUtil.startPerformanceTest(getTestName(false), 20_000, configureAndComplete(text)).attempts(1).usesAllCPUCores().assertTiming() } void testClosureRecursion() { @@ -447,7 +447,7 @@ class AwsService { } } ''' - measureHighlighting(text, 500) + measureHighlighting(text, 700) } ThrowableRunnable configureAndComplete(String text) { diff --git a/spellchecker/testSrc/com/intellij/spellchecker/inspection/SpellcheckerPerformanceTest.java b/spellchecker/testSrc/com/intellij/spellchecker/inspection/SpellcheckerPerformanceTest.java index 7c306abc3254..2619ddc883d4 100644 --- a/spellchecker/testSrc/com/intellij/spellchecker/inspection/SpellcheckerPerformanceTest.java +++ b/spellchecker/testSrc/com/intellij/spellchecker/inspection/SpellcheckerPerformanceTest.java @@ -58,7 +58,7 @@ public class SpellcheckerPerformanceTest extends SpellcheckerInspectionTestCase assertSize(typoCount, runLocalInspections()); System.out.println("warm-up took " + (System.currentTimeMillis() - start) + " ms"); - PlatformTestUtil.startPerformanceTest("many typos highlighting", 10000, () -> { + PlatformTestUtil.startPerformanceTest("many typos highlighting", 11_000, () -> { DaemonCodeAnalyzer.getInstance(getProject()).restart(); assertSize(typoCount, runLocalInspections()); }).assertTiming();