From afe490023ff97d343f5985c2341bd169df3059fb Mon Sep 17 00:00:00 2001 From: Bas Leijdekkers Date: Fri, 9 Jun 2017 09:36:35 +0200 Subject: [PATCH] make performance test --- .../spellchecker/compress/DictionaryTest.java | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/spellchecker/testSrc/com/intellij/spellchecker/compress/DictionaryTest.java b/spellchecker/testSrc/com/intellij/spellchecker/compress/DictionaryTest.java index 67dc62fba824..9c76ad546aae 100644 --- a/spellchecker/testSrc/com/intellij/spellchecker/compress/DictionaryTest.java +++ b/spellchecker/testSrc/com/intellij/spellchecker/compress/DictionaryTest.java @@ -40,14 +40,14 @@ public class DictionaryTest { private final Transformation myTransformation = new Transformation(); @Test - public void testJBDictionary() { + public void testJBDictionaryPerformance() { Dictionary dictionary = loadDictionaryPerformanceTest(JETBRAINS_DIC, 1000); containsWordPerformanceTest(dictionary, 2000); containsWordTest(dictionary); } @Test - public void testEnglishDictionary() { + public void testEnglishDictionaryPerformance() { Dictionary dictionary = loadDictionaryPerformanceTest(ENGLISH_DIC, 50000); containsWordPerformanceTest(dictionary, 2000); containsWordTest(dictionary); @@ -72,23 +72,15 @@ public class DictionaryTest { private Dictionary loadDictionaryPerformanceTest(final String name, int time) { final Ref ref = Ref.create(); - if (PlatformTestUtil.COVERAGE_ENABLED_BUILD) { - return CompressedDictionary.create(getLoader(name), myTransformation); - } - else { - PlatformTestUtil.startPerformanceTest( - "load dictionary", time, - () -> ref.set(CompressedDictionary.create(getLoader(name), myTransformation)) - ).useLegacyScaling().assertTiming(); - } + PlatformTestUtil.startPerformanceTest( + "load dictionary", time, () -> ref.set(CompressedDictionary.create(getLoader(name), myTransformation)) + ).useLegacyScaling().assertTiming(); assertFalse(ref.isNull()); return ref.get(); } private void containsWordPerformanceTest(final Dictionary dictionary, int time) { - if (PlatformTestUtil.COVERAGE_ENABLED_BUILD) return; - final Set wordsToCheck = createWordSets(dictionary, 50000, 1).first; PlatformTestUtil.startPerformanceTest("contains word", time, () -> { for (String s : wordsToCheck) {