Open
Conversation
This avoids repetitive schema definitions of arrays
✅ Deploy Preview for cute-starship-2d9c9b canceled.
|
Owner
Author
|
So, it works, but it makes small + reasonable schemas a bit bigger (10% or so) on the wire (and a lot more complicated), it's a draw/slight win for "medium" schemas, and really only shines against silly nested/repetitive types. Hmmm. Bummer. |
Collaborator
|
Can we split the array schema change out of this? That seems like a relatively straightforward addition, though I'm wondering if we want to make Re. interning, I haven't had time to look into this implementation yet. I thought a lot about interning trees like this a while ago, maybe I can dig up some tricks |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Still in progress, I have some string interning working, and starting to figure out the type interning.
This attempts to make a third representation for schemas, intended to make a much smaller wire form. This pulls all strings and subtypes into a deduplicated list, then describes types using references to the attached str/ty data.
I also hope to see if I can emit this to a serialized
&'static [u8]at compile time so you don't need to actually serialize the schema at runtime.CC @max-heller if you have any thoughts on the approach. I also introduced an explicit "array" type to the data model, to get away from using tuple for that.
IMO: this is a breaking "Schema" type change, but is NOT a breaking postcard wire change: fixed size arrays are encoded the same way, they are just described differently.