You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we have a type that includes another datatype and so on, we still have a write command for each type even so at compile time we would know the entire 'chain'
an example would be:
structS1{v:Vec<u8>}structS2{s1:S1}structS3{s2:S2}
serializing S3 would write {"s2": then {"s1": then {"v": then [ and only then the data.
A human observer will notice that we could reduce this to a single call of {"s2":{"s1":{"v":[.
At the same time we can notice that we do the same on the 'tail' where we will write ] then } then } then }.
A human observer, again, will notice that we could reduce this to a single call of ]}}}.
The same logic can be applied to combining <key>:{ and }, for keys that are neither first nor last to reduce write calls further.
An initial though is to split the encoding out into 3 sections:
static start
body
static end
where 1 and 3 take the form of fn static_*() -> &'static u8 so the proc macro can call them on underlying structs to inline those parts of a sub type.
The text was updated successfully, but these errors were encountered:
If we have a type that includes another datatype and so on, we still have a write command for each type even so at compile time we would know the entire 'chain'
an example would be:
serializing
S3
would write{"s2":
then{"s1":
then{"v":
then[
and only then the data.A human observer will notice that we could reduce this to a single call of
{"s2":{"s1":{"v":[
.At the same time we can notice that we do the same on the 'tail' where we will write
]
then}
then}
then}
.A human observer, again, will notice that we could reduce this to a single call of
]}}}
.The same logic can be applied to combining
<key>:{
and},
for keys that are neither first nor last to reduce write calls further.An initial though is to split the encoding out into 3 sections:
where 1 and 3 take the form of
fn static_*() -> &'static u8
so the proc macro can call them on underlying structs to inline those parts of a sub type.The text was updated successfully, but these errors were encountered: