Pure.DI icon indicating copy to clipboard operation
Pure.DI copied to clipboard

Performance of the source generator.

Open lsoft opened this issue 4 months ago • 15 comments

Hello!

I'm not sure about these topics, so I post them here only fyi.

  1. If I understand the things right, then https://github.com/DevTeam/Pure.DI/blob/master/src/Pure.DI/SourceGenerator.cs#L27 means you are collecting all syntax nodes inside a whole source tree of the project (solution?). Looks like it will have scaling problems. What are performance of this approach? Is there any performance benefits in comparison with old ISourceGenerator?
  2. Again, If I not missed something, pushing GeneratorSyntaxContext into generator pipeline https://github.com/DevTeam/Pure.DI/blob/master/src/Pure.DI/SourceGenerator.cs#L28 renders the generator to be completely non incremental. Additional context can be found here: https://github.com/zompinc/sync-method-generator/issues/20

As an author of similar library https://github.com/lsoft/DpDtInject I found no way to effiently apply incremental source generators for the task of DI. If I wrong, could you share where did I miss?

Good luck! Thanks!

lsoft avatar Feb 28 '24 12:02 lsoft