convex
convex copied to clipboard
Compact small data structure encoding
Small data structures (0-2 elements) are very common. There is an opportunity to reduce average encoding size by embedding short lengths as bits in the tag byte.
Proposal:
- 2 bits in tag byte are used to indicate length (00 = 0, 01 = 1, 10 = 2, 11 = 3 or more)
- Count is included for the data structure if and only if this is 3 or more