Skip to content

trie/bintrie: flag-byte serialization for stem padding (follow-up to #34055) #34759

Description

@CPerezz

In PR #34055 review comment 3101638279, @gballet suggested on `trie/bintrie/store_commit.go:157` (stem-node serialization):

might be worth putting some flag in the first byte instead of storing 0s. That should save a lot of disk, even though the compression code should also take care of that I guess.

Tracked as a follow-up because it's a wire-format change that shouldn't be conflated with the current arena / refactor PR:

Scope here:

  1. Define the flag-byte encoding (which bits mean what, how empty slots are distinguished from present-but-zero).
  2. Bump a format version so existing DBs can be detected at open and either migrated or rejected cleanly.
  3. Measure the actual disk-size delta vs. the compressed baseline — gballet's own hedge ("the compression code should also take care of that I guess") means the win may be marginal post-compression.
  4. Implement + benchmark + land.

Blocker/depends-on: #34055 merging first (or at least the `store_commit.go` refactor in it stabilising) so we're not fighting conflicts.

cc @gballet @CPerezz

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions