Skip to content

Commit

Permalink
Reduce the size of type information in durable coroutine state (#114)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
chriso authored Nov 21, 2023
2 parents 03fcabb + 8a851f5 commit 00b9eb6
Show file tree
Hide file tree
Showing 16 changed files with 577 additions and 489 deletions.
57 changes: 34 additions & 23 deletions gen/proto/go/coroutine/v1/coroutine.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 48 additions & 1 deletion gen/proto/go/coroutine/v1/coroutine_vtproto.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions gen/proto/go/coroutine/v1/function.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 10 additions & 26 deletions gen/proto/go/coroutine/v1/function_vtproto.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 00b9eb6

Please sign in to comment.