-
Notifications
You must be signed in to change notification settings - Fork 664
Improve serialization speed of enums without data in C# #2762
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rekhoff
approved these changes
May 20, 2025
Contributor
rekhoff
left a comment
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, summary, comments, and tests all look good. I have not tested to verify a meaningful speed improvement but changes seem reasonable. Approved.
4230824 to
22c8b68
Compare
Contributor
Author
|
I've run through the Bitcraft tutorial and am happy with this, ready to merge. |
3 tasks
bfops
added a commit
to clockworklabs/com.clockworklabs.spacetimedbsdk
that referenced
this pull request
Jun 23, 2025
## Description of Changes Updates the DLLs for clockworklabs/SpacetimeDB#2762, and bumps our version numbers as well. ## API - [ ] This is an API breaking change to the SDK Not a breaking change ## Requires SpacetimeDB PRs None afaik ## Testsuite SpacetimeDB branch name: master ## Testing *Write instructions for a test that you performed for this PR* - [x] Ran through Bitcraft tutorial - [x] Blackholio on CI --------- Co-authored-by: James Gilles <jameshgilles@gmail.com> Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
joshua-spacetime
pushed a commit
that referenced
this pull request
Jul 1, 2025
bfops
added a commit
that referenced
this pull request
Jul 17, 2025
## Description of Changes Updates the DLLs for #2762, and bumps our version numbers as well. ## API - [ ] This is an API breaking change to the SDK Not a breaking change ## Requires SpacetimeDB PRs None afaik ## Testsuite SpacetimeDB branch name: master ## Testing *Write instructions for a test that you performed for this PR* - [x] Ran through Bitcraft tutorial - [x] Blackholio on CI --------- Co-authored-by: James Gilles <jameshgilles@gmail.com> Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
bfops
added a commit
to clockworklabs/com.clockworklabs.spacetimedbsdk
that referenced
this pull request
Jul 28, 2025
## Description of Changes Updates the DLLs for clockworklabs/SpacetimeDB#2762, and bumps our version numbers as well. ## API - [ ] This is an API breaking change to the SDK Not a breaking change ## Requires SpacetimeDB PRs None afaik ## Testsuite SpacetimeDB branch name: master ## Testing *Write instructions for a test that you performed for this PR* - [x] Ran through Bitcraft tutorial - [x] Blackholio on CI --------- Co-authored-by: James Gilles <jameshgilles@gmail.com> Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
performance
A PR/Issue related to improving performance of stdb
release-any
To be landed in any release window
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Changes
I was looking at a bitcraft profile and it was still spending a lot of time in reflection when deserializing enums without data -- plain-old-enums. Turns out the code I thought was dead was not. So, I changed it to be as fast as possible (indexing into an array!) This should save a few more allocations and some deserialization time. I also changed the generated .Equals for
[SpacetimeDB.Type]s containing enums to avoid an allocation.API and ABI breaking changes
Expected complexity level and risk
0
Testing
I am planning to test: