Reduce the size of type information in durable coroutine state #114
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.
Now that we can inspect durable coroutine state (#113), a few optimizations are clear.
Firstly, package names are currently duplicated across types. This PR updates the serialization layer to intern strings so that there's no duplication.
Secondly, the serialization layer currently stores type information for all referenced types (recursively). When custom serializers are registered this type information is not used; we just need a reference to the custom serialization routines. An offline process analyzing the state doesn't need this information either, because the custom serializer might emit entirely different objects/types. Since #112, type information is available for the output of custom serializers, so the input type info isn't necessary. This PR updates the serialization layer to no longer store type information for types with custom serializers. All that's stored now is the interned package name and type name, along with the
custom
flag which indicate that the type is opaque. When stacked with #104, the reduction in the size of type information can be drastic.