Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove repeated calls to EasyCodingStandardStyle->isDebug() #194

Merged
merged 1 commit into from Apr 19, 2024

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Apr 19, 2024

repeating isDebug calls are showing up in the top 6 of memory consuming methods, measured by blackfire:
(because this method is called from processTokensByFixer which is the most called function in the whole project)

grafik

@@ -44,6 +46,7 @@ public function __construct(
array $fixers
) {
$this->fixers = $this->sortFixers($fixers);
$this->isDebug = $easyCodingStandardStyle->isDebug();
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this need to be applied in EasyCodingStandardApplication and File object as well?

Copy link
Contributor Author

@staabm staabm Apr 19, 2024

Choose a reason for hiding this comment

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

I did it only here to keep the PR minimal. isDebug() is not per se slow/hungry, but in this special case which is called very frequently. other occurences do not show up in profilling.

Copy link
Collaborator

@samsonasik samsonasik left a comment

Choose a reason for hiding this comment

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

Thank you @staabm , let's give it a try.

@samsonasik samsonasik merged commit 58daa82 into easy-coding-standard:main Apr 19, 2024
7 checks passed
@staabm staabm deleted the debug branch April 19, 2024 07:35
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.

None yet

2 participants