Is your feature request related to a problem or challenge? Please describe what you are trying to do.
Boolean struct fields in the Thrift compact protocol are encoded solely as either FieldTypeFalse or FieldTypeTrue, with no encoded data. When parsing a Thrift field header, the current parser will save an Option<bool> in the FieldIdentifier struct, which is then used to fill in the value for the struct field. This leads to some complicated branching in read_field_begin, which is on the hot path.
Describe the solution you'd like
Remove the bool_val field from the FieldIdentifier and instead use the field_type to determine whether true or false was encoded.
Describe alternatives you've considered
Additional context
The current behavior is a carryover from the behavior of the old generated parser.
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
Boolean struct fields in the Thrift compact protocol are encoded solely as either
FieldTypeFalseorFieldTypeTrue, with no encoded data. When parsing a Thrift field header, the current parser will save anOption<bool>in theFieldIdentifierstruct, which is then used to fill in the value for the struct field. This leads to some complicated branching inread_field_begin, which is on the hot path.Describe the solution you'd like
Remove the
bool_valfield from theFieldIdentifierand instead use thefield_typeto determine whethertrueorfalsewas encoded.Describe alternatives you've considered
Additional context
The current behavior is a carryover from the behavior of the old generated parser.