perf: zstd level 1 beats the default level 3 on the per-value path for large text values

Aperta
#10,527 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
performance

Direzione di ricerca

The issue points to the per-value compression path in lance-encoding; locate the default zstd level constant (likely gated by compression-level config). Review PR #10531 and issue #10311 for context, then benchmark large JSON values as described. Done means a PR lowering the default to 1 with data from multiple value types, or documentation advising level 1 for large text.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

performance

Observation

On the per-value (full-zip) path the default general compressor is zstd at the crate default level (3). On large JSON documents level 1 compresses better and faster than level 3, and levels 6 and 9 add nothing. Measured on two fragments (50k rows, 11 GB) of a real table with 180 KB observations_json and 38 KB commanded_actions_json values, lance main at bf867011a with parallel per-value compression (#10531), 64 cores:

per-value zstd level output ratio write wall write CPU scan (THP on)
default (3) 3 519 MB 3.11x 9.4 s 69 s 2.5 s
1 3 338 MB 3.28x 8.3 s 41 s 1.7 s
6 3 391 MB 3.23x 10.3 s 198 s 2.5 s
9 3 391 MB 3.23x 12.4 s 307 s 2.5 s

Raw codec numbers on the same bytes (python zstandard, single thread, whole buffer): L1 3.63x at 473 MB/s, L3 3.69x at 239 MB/s, L9 4.41x at 66 MB/s; decompression 830-950 MB/s for all levels. On commanded_actions_json L1 also beats L3 on ratio (2.49x vs 2.37x).

Per-value frames also lose a lot of ratio on short values compared with whole-block compression (6 KB values: 2.9x vs 6.4x; 1.7 KB: 2.1x vs 5.6x; 300 B: 1.3x vs 35x); a 110 KB trained zstd dictionary recovers most of it (5.6x / 4.7x / 5.7x). That is a format-level question, noted here for the compression survey (#10311 covers the mini-block side).

Suggestion

Consider level 1 as the per-value default, or at least document that lance-encoding:compression-level=1 is the sensible setting for large text/JSON values. Data from other value types (vectors via #10170, binary blobs) is needed before changing the default.

Lingua principale
Rust
Stelle
7.3k
Fork
929
Merge medio
2g 22h
PR unite (30g)
572

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di lance-format/lance

Tutte le issue di lance-format/lance

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.