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 generation performance by calling packages.Load only once #521

Closed
LandonTClipp opened this issue Dec 14, 2022 · 1 comment
Closed

Comments

@LandonTClipp
Copy link
Collaborator

I've discovered that we can likely get a huge performance benefit by calling packages.Load only once. Currently, it is called once per file, which means that the entire dep tree is being loaded multiple times, thus resulting in O(n^2) performance. We should instead gather the list of files to load, then make one call to packages.Load. This should improve performance.

https://github.com/vektra/mockery/blob/master/pkg/parse.go#L76

https://github.com/vektra/mockery/blob/master/pkg/parse.go#L100

@LandonTClipp
Copy link
Collaborator Author

This will probably be implemented as part of #526

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

No branches or pull requests

1 participant