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

Calculate diff only once per file after refactoring #3711

Merged
merged 5 commits into from Apr 30, 2023

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Apr 29, 2023

@staabm staabm marked this pull request as ready for review April 29, 2023 20:04
@@ -186,9 +203,6 @@ private function printFile(File $file, Configuration $configuration): void
}

$file->changeFileContent($newContent);
if ($configuration->shouldShowDiffs()) {
$this->fileDiffFileDecorator->decorate([$file]);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

generation of the file-diff (comparing contents, generate a diff) is slow.

therefore we just remember all other information while in flight and do the actual content comparison/diff generation only once after the loop

@samsonasik
Copy link
Member

Looking good, lets give it a try, thank you @staabm

@samsonasik samsonasik merged commit c3aca95 into rectorphp:main Apr 30, 2023
39 checks passed
@staabm staabm deleted the later-diff branch April 30, 2023 05:45
samsonasik pushed a commit that referenced this pull request May 8, 2023
* Calculate diff only once per file after refactoring

* fix

* fix

* fix

* ecs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants