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

Saving files with Code Cleanup with Pure.DI - performance issue #26

Closed
michalciolek opened this issue Mar 3, 2023 · 3 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@michalciolek
Copy link

michalciolek commented Mar 3, 2023

Hello, I have a large Winforms project with about 500 DI classes. When I save files, Visual Studio stuck on (for 50-500s):
pure00
In VS 2022 (17.5.1) I have enabled Options -> Text Editor -> Codde Cleanup -> Run Code Cleanup profile on Save. In profile, I have only: Remove unnecessary Imports.

Using the second VS instance I attached it to the first VS instance and dump active Tasks:
pure01

It looks like, Pure.DI unnecessarily runs during CodeCleanup. When I uninstall Pure.DI Code Cleanup runs very fast.

PureDI logs show only:
WRN Tracer: The path is empty.

How can I help you solve this problem? I was able to successfully migrate my entire project to PureDI. Unfortunately, with such performance in VS it is impossible to work ...

@michalciolek michalciolek changed the title Code Cleanup with Pure.DI - performance issue Saving files with Code Cleanup with Pure.DI - performance issue Mar 3, 2023
@NikolayPianikov
Copy link
Member

Sorry I haven't used VS for years (I used Rider) and can't reproduce this problem right now for some huge solution. I'll try to find a workaround when I reproduce it. Could you clean up the solution and rebuild it from scratch in VS. How long does it take with and without Pure.DI?

What happens when you disable automatic cleanup and do it manually?

The latest C# code generators support an incremental API, and Pure.DI will use this API in v2.

@NikolayPianikov NikolayPianikov self-assigned this Mar 3, 2023
@NikolayPianikov NikolayPianikov added the bug Something isn't working label Mar 3, 2023
@NikolayPianikov
Copy link
Member

NikolayPianikov commented Mar 3, 2023

By the way, this stack is related to the use of factories, perhaps Pure.DI has some inefficient code for this case. I'll try to look in that direction.

@NikolayPianikov
Copy link
Member

Fixed in v2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants