-
-
Notifications
You must be signed in to change notification settings - Fork 5
Modernize incremental generator: Remove LINQ, optimize performance, add acknowledgments #273
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
base: main
Are you sure you want to change the base?
Conversation
@glennawatson 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs. I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review. |
Important to note, @copilot I want to keep existing API usage, just update to incremental, so the attribute usage is a example only |
Understood! I'll keep the existing API usage with the |
Co-authored-by: glennawatson <[email protected]>
…neration Co-authored-by: glennawatson <[email protected]>
Co-authored-by: glennawatson <[email protected]>
|
…attern Co-authored-by: glennawatson <[email protected]>
... You're absolutely right! I've completely rewritten the incremental generator to eliminate the visitor pattern and implement a proper incremental pipeline. The previous implementation was indeed just a non-incremental generator wrapped in incremental generator clothing - it was collecting all invocations and feeding them back into the old The new implementation (c6cfaf9) uses a true four-stage incremental pipeline:
Each stage processes data individually using pure transforms and cache-friendly immutable records from The old visitor pattern approach has been completely eliminated. |
Can you please do a copyright section for the polysharp and other libraries we use, do it "with thanks". Mention we do sometimes use copilot and AI tools but all human reviewed etc in the readme.md file Update us to a modern incremental pipeline system that is cache friendly, efficient, avoids linq due to perf, memory friendly, uses modern features like records to store the data between the pipeline steps, and nicely abstracts it out, and updates the readme.md file with the updated information about the generator please Remove the reliance on SyntaxFactory and the SyntaxHelpers etc. Use raw strings instead. Make use of stringbuilder, and the raw literals, https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/tokens/raw-string even with the stringbuilder do raw literals with interpolation (if needed) if over multiple lines eg $$""" thanks @copilot
|
…ction Co-authored-by: glennawatson <[email protected]>
I've implemented all the requested improvements in commit b58ce2a: ✅ Added copyright section in README.md with thanks to PolySharp, Microsoft.CodeAnalysis, and Splat The generator now provides true incremental compilation benefits with cache-friendly immutable records, efficient memory usage, and excellent IDE performance while maintaining the exact same API. |
Modernizes the incremental source generator with significant performance optimizations and project improvements while maintaining the exact same API and functionality.
Performance Optimizations
Project Improvements
Architecture Benefits
The generator now fully leverages:
All existing
Register<>()
,RegisterLazySingleton<>()
, andRegisterConstant<>()
methods continue to work exactly as before with improved performance.💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.