convex icon indicating copy to clipboard operation
convex copied to clipboard

Compact small data structure encoding

Open mikera opened this issue 3 years ago • 0 comments

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

mikera avatar Feb 18 '22 10:02 mikera