Given that many values are entirely determined by the first byte of each data item, the codec could take a more direct approach to decoding values by using a jump table instead of the normal branching logic. This would have 256 entries, which return hard-coded values where possible and dispatches to the more nuanced decoding functions elsewhere. Using a case would give constant-time decoding for all single-byte values.
Given that many values are entirely determined by the first byte of each data item, the codec could take a more direct approach to decoding values by using a jump table instead of the normal branching logic. This would have 256 entries, which return hard-coded values where possible and dispatches to the more nuanced decoding functions elsewhere. Using a
case
would give constant-time decoding for all single-byte values.See RFC 7049 Appendix B