-
Notifications
You must be signed in to change notification settings - Fork 540
Reduce reflection use in generated C# code #2725
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
Conversation
f574d87
to
df4a55d
Compare
df4a55d
to
8804a70
Compare
c27bf8a
to
0c741a6
Compare
8804a70
to
afdc188
Compare
Add important comment Make enums more direct Comments and csharpier Add method to IStructuralReadWrite to get an IReadWrite<Self>. This is technically a breaking change if anyone is manually implementing IStructuralReadWrite. Remove incorrect comment
d070125
to
74ad4a1
Compare
Git mistake. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code changes made a lot of sense to me and look clear. I also apricate the additional summary text on the existing code. As long as these get tested against Blackholio and Bit Craft, then I think this looks good.
I've tested against Blackholio and Bitcraft, happy with this. |
## Description of Changes Leverages clockworklabs/SpacetimeDB#2725 to speed up row deserialization. Also updates DLLs for recent upstream fixes. Changes: - Uses much simpler code when deserializing enums, avoiding the use of reflection - Uses manually monomorphized row deserialization methods, which again avoid the use of reflection when constructing row objects ## API - [ ] This is an API breaking change to the SDK *If the API is breaking, please state below what will break* ## Requires SpacetimeDB PRs clockworklabs/SpacetimeDB#2725 ## Testsuite SpacetimeDB branch name: jgilles/perf/faster-allocation ## Testing *Write instructions for a test that you performed for this PR* - [x] Blackholio - [x] Bitcraft (have done a basic test but no in-depth testing)
Description of Changes
Directly allocates results for some operations and avoids the usage of reflection for enum serialization.
This should hopefully speed up (de)serialization to some extent.
Needs to be paired with an upcoming C# SDK PR to speed these up further.
API and ABI breaking changes
Adds a method to IStructuralReadWrite, which will break anyone who manually implements it. However, nobody should be manually implementing it. I've checked, and Bitcraft doesn't.
Expected complexity level and risk
0
Testing