Skip to content

Commit 349d3cb

Browse files
committed
Remove ParserKind reference from Perf test
1 parent 4486ea0 commit 349d3cb

File tree

2 files changed

+22
-29
lines changed

2 files changed

+22
-29
lines changed

Performance.php

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
use Exception;
77
use LanguageServer\Index\Index;
8-
use LanguageServer\ParserKind;
98
use LanguageServer\PhpDocument;
109
use LanguageServer\DefinitionResolver;
1110
use Microsoft\PhpParser;
@@ -32,40 +31,35 @@
3231
throw new Exception("ERROR: Validation testsuite frameworks not found - run `git submodule update --init --recursive` to download.");
3332
}
3433

34+
$start = microtime(true);
3535

36-
$parserKinds = [ParserKind::PHP_PARSER, ParserKind::TOLERANT_PHP_PARSER];
37-
foreach ($parserKinds as $kind) {
38-
$start = microtime(true);
39-
40-
foreach ($testProviderArray as $idx => $testCaseFile) {
41-
if (filesize($testCaseFile) > 10000) {
42-
continue;
43-
}
44-
if ($idx % 1000 === 0) {
45-
echo "$idx\n";
46-
}
36+
foreach ($testProviderArray as $idx => $testCaseFile) {
37+
if (filesize($testCaseFile) > 10000) {
38+
continue;
39+
}
40+
if ($idx % 1000 === 0) {
41+
echo "$idx\n";
42+
}
4743

48-
$fileContents = file_get_contents($testCaseFile);
44+
$fileContents = file_get_contents($testCaseFile);
4945

50-
$docBlockFactory = DocBlockFactory::createInstance();
51-
$index = new Index;
52-
$maxRecursion = [];
53-
$definitions = [];
46+
$docBlockFactory = DocBlockFactory::createInstance();
47+
$index = new Index;
48+
$maxRecursion = [];
49+
$definitions = [];
5450

55-
$definitionResolver = new DefinitionResolver($index);
56-
$parser = new PhpParser\Parser();
51+
$definitionResolver = new DefinitionResolver($index);
52+
$parser = new PhpParser\Parser();
5753

58-
try {
59-
$document = new PhpDocument($testCaseFile, $fileContents, $index, $parser, $docBlockFactory, $definitionResolver);
60-
} catch (\Throwable $e) {
61-
continue;
62-
}
54+
try {
55+
$document = new PhpDocument($testCaseFile, $fileContents, $index, $parser, $docBlockFactory, $definitionResolver);
56+
} catch (\Throwable $e) {
57+
continue;
6358
}
59+
}
6460

65-
echo "------------------------------\n";
66-
67-
echo "Time [$framework, $kind]: " . (microtime(true) - $start) . PHP_EOL;
61+
echo "------------------------------\n";
6862

69-
}
63+
echo "Time [$framework]: " . (microtime(true) - $start) . PHP_EOL;
7064
}
7165

tests/Validation/ValidationTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use Exception;
88
use LanguageServer\Definition;
99
use LanguageServer\Index\Index;
10-
use LanguageServer\ParserKind;
1110
use LanguageServer\PhpDocument;
1211
use LanguageServer\DefinitionResolver;
1312
use phpDocumentor\Reflection\DocBlock;

0 commit comments

Comments
 (0)