© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•17mo ago•
51 replies
Pedro Gil Mora

Dictionary vs switch in source generated code

I have doubt.
Im generating a compiled communication framework and the "endpoint handler" is a dictionary is int64 key-based with actions processing the context. keyvalue pairs are generated with my source generator. My question is. if I generate the equivalent switch to handle like 150 cases in compile time. would be inefficient?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements
Next page

Similar Threads

✅ Error in VS Code
C#CC# / help
2y ago
✅ Error in VS Code.
C#CC# / help
2y ago
✅ Resource Dictionary(Code behind)
C#CC# / help
2y ago
❔ Why do my source generated properties are unreacheable in code? using mvvm toolkit
C#CC# / help
3y ago