Skip to content

Conversation

@staabm
Copy link
Contributor

@staabm staabm commented Jan 14, 2026

No description provided.

$error = $this->ruleErrorTransformer->transform($ruleError, $scope, $parserNodes, $node);

if ($error->canBeIgnored()) {
foreach ($this->ignoreErrorExtensionProvider->getExtensions() as $ignoreErrorExtension) {
Copy link
Contributor Author

@staabm staabm Jan 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this method was invoked once for every error found

$error = $this->ruleErrorTransformer->transform($ruleError, $scope, $parserNodes, $node);

if ($error->canBeIgnored()) {
foreach ($this->ignoreErrorExtensionProvider->getExtensions() as $ignoreErrorExtension) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could make sense to move it completely out of the callback and just use its variable? Maybe measure the memory difference.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot see a measurable improvement, even though this loop callback is invoked 800.000 times

@staabm staabm changed the title FileAnalyser: Move repetative work out of hot loop FileAnalyser: Move repetitive work out of hot loop Jan 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants