-
Notifications
You must be signed in to change notification settings - Fork 19
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
Is it possible to encode recursive types? #35
Comments
Recursive types are not implemented (edit: for Edit: for |
Thx. So, is this feature not planned? Or will it be possible again someday? |
Not currently planned, but the documentation could be more clear about this so I'll leave the issue open. |
Can use 0.6 with serde if you remove serde untagged from your enums. Serde untagged breaks most binary formats even if some don't complain right away. |
Yes, it works, only the purpose in reducing the amount of data is not fulfilled. In this case enum identifier is written, which significantly increases the file size. I compared with dlhn, however it cannot decode this. The size becomes larger than my daletpack format, which does not compress well. Is it possible to implement serde(untagged) support in your case? |
No, because Consider the case of Making The
If you can provide specific details (schema + encoding) of how you can outperform |
This format is specifically designed for my schema, but it doesn't compress well (I'm not very knowledgeable about how to optimize this), so I'm looking for solutions that are already out there. It's not for all data types, so it won't help you. For my format, I had the idea of exposing each type (if it's an enum) and writing a separate identifier for each one. For example enum Enum {
First(Other),
Second(Other)
}
enum Other {
String(String),
Num(u8)
} Enum in this case has 4 binary identifiers for each type Enum::FirstString Enum::SecondString I don't know how procedurally realizable this is, but it should work. I don't know if this structure compresses well either. I partially implemented this in the daletpack scheme (but still eventually would like to do it for all types and procedurally) |
After running your benchmark it looks like various formats take ~300 bytes. I would recommend testing on a larger dataset if you want to accurately benchmark compression. Compression algorithms are generally inefficient in terms of size and speed on input smaller than tens of kilobytes. Also zlib is just a wrapper of deflate. |
Hi ! I have a few types that contain |
I recently added a warning to the README about this; |
In serde version there is error:
type changed
The text was updated successfully, but these errors were encountered: