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

The source generator is completely non incremental #82

Closed
Sergio0694 opened this issue Oct 4, 2023 · 1 comment · Fixed by #83
Closed

The source generator is completely non incremental #82

Sergio0694 opened this issue Oct 4, 2023 · 1 comment · Fixed by #83

Comments

@Sergio0694
Copy link
Contributor

Just FYI, the incremental pipeline of the source generator is completely broken (as in, it's not incremental at all). This will have awful performance, as source files will be recomputed for every single edit. Additionally, this will unnecessarily root compilation objects, increasing memory use.

The problematic line is this (among others):

context.RegisterSourceOutput(valueProvider, static (spc, source) => Execute(source.compilation, source.classes, spc, source.options));

You should never have any compilations or symbols in any steps of your incremental pipelines, and especially in output steps. Those objects are not equatable and not meant to be used this way.

@k94ll13nn3
Copy link
Owner

Thank you for taking the time to look at that.
I will look at it, I think I was not totally aware of all of this when i made the switch from the old model to the incremental model, so it does not suprise me that I did not made the right code.

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 a pull request may close this issue.

2 participants