Skip to content

raw_json: measure zstd with a trained dictionary #97

Open

Description

@neoromantic

raw_json is the biggest part of a cache (43–61% in #79). Per-row gzip helped little (706 to 448 bytes for one message), because each row is small. A shared dictionary trained on the account's own raw_json (zstd) may compress much better.

The cost: tg sql users read raw_json with json_extract, which wouldn't work on compressed rows unless tg offers a way to decompress in SQL or keeps the fields people query in columns.

Proposed: measure on the #80 benchmark (bytes per message, write and read time) whether zstd with a trained dictionary is available in Bun, how much it saves after #86, and what tg sql would need. Decide in docs/storage.md; implement only if the saving is large.

Done when the benchmark reports the numbers and the design doc decides. Depends on #80 and #86.

Activity

  1. added
    enhancement
    on Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions