Skip to content

Commit

Permalink
Add profiling for analysing slow methods
Browse files Browse the repository at this point in the history
  • Loading branch information
muglug committed Mar 29, 2020
1 parent 194f025 commit ce35324
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Psalm/Internal/Analyzer/ClassAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -1742,6 +1742,8 @@ private function analyzeClassMethod(

$type_provider = new \Psalm\Internal\Provider\NodeDataProvider();

$time = microtime(true);

$method_analyzer->analyze(
$method_context,
$type_provider,
Expand All @@ -1766,6 +1768,11 @@ private function analyzeClassMethod(
);
}

$project_analyzer->progress->debug(
'Analyzing method ' . $stmt->name . ' took '
. number_format(microtime(true) - $time, 4) . "seconds \n"
);

if (!$method_already_analyzed
&& !$class_context->collect_initializations
&& !$class_context->collect_mutations
Expand Down

0 comments on commit ce35324

Please sign in to comment.