Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Following on from #107, this PR updates the serialization layer to store types separately from the serialized graph of objects. The protobuf `Type` message carries the same information as a `reflect.Type`, with a bit of extra metadata. Types are stored in an array where the index is the type's unique ID. This allows us to encode a graph of types (potentially with cycles) by referencing types by ID. I had to remove the global type cache in favor of a local cache on each `Serializer` instance. This allows us to produce a succint array that encodes just the types that are relevant to a particular serialized state, rather than having to work with a subgraph of all types (and a sparse set of type IDs).
- Loading branch information