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

improve analysing performance #283

Merged
merged 1 commit into from Jan 29, 2020
Merged

improve analysing performance #283

merged 1 commit into from Jan 29, 2020

Conversation

smoench
Copy link
Contributor

@smoench smoench commented Jan 28, 2020

blackfire run php deptrac.php analyse examples/symfony_depfile.yml --formatter-console=0 --no-cache

https://blackfire.io/profiles/compare/17f1bcf2-dc12-4a59-933f-4c9a93cc2da1/graph
image

@timglabisch
Copy link
Collaborator

wow, nice ;)

@timglabisch timglabisch self-requested a review January 28, 2020 19:55
@smoench smoench merged commit e8910ab into master Jan 29, 2020
@smoench smoench deleted the analysing-perfomance branch January 29, 2020 06:45
@nicolas-grekas
Copy link

Nice, it's true that RewindableGenerator is not supposed to be rewound millions of times, better use an array in this case.
Note that you could have used iterator_to_array($classDependencyResolvers, false) internally instead of changing the signature and dropping the possibility to inject new resolvers via a tag.

@smoench
Copy link
Contributor Author

smoench commented Jan 29, 2020

Yes, iterator_to_array would have been a possibility. But IMHO it is an implementation detail of Symfony and the class shouldn't care about it.

I'm fine with this solution as it guarantees type declarations and in case there is a need using tags for resolvers again I will probably use a compiler pass :-)

@smoench smoench added this to the 0.7 milestone Jan 31, 2020
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

3 participants