Quiz
- Why is it not always more optimal to use
varint
for integer types?- No reason, they are always more optimal than fixed integers
varint
encoding serializes bigger numbers into a bigger amount of bytesvarint
encoding serializes smaller numbers into a bigger amount of bytes
- How can we get the number of bytes a message will be serialized into?
proto.Marshal +
len
proto.UnMarshal +
len
len
- What kind of tag should we give to fields that are often populated?
- Bigger tags
- Smaller tags
- What is the main problem of splitting messages to use smaller tags?
- We have overhead because sub-messages are serialized as length-delimited types
- No problem – this is the way to go
- What is
FieldMask
?- A collection of fields’ paths telling us what data to exclude
- A collection of fields’ paths telling us what data to include
- When is a repeated field serialized as unpacked?
- When repeated fields are acting on scalar types
- Only when we use the packed option with the value
false
- When...