perf: page faults on fresh decode buffers cost as much CPU as decoding large columns
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- rust
- 領域
- performance
調査の方向性
Start from LanceBuffer allocation and the decode path that builds Arrow output buffers per batch; reproduce the scan benchmark from the issue and profile page faults. Compare reusing decode output buffers across batches against backing large allocations with madvise(MADV_HUGEPAGE), using #10524 for the environment-variable context. Done means the scan shows the reported CPU/page-fault reduction without requiring users to set allocator tunables.
索引モデルが issue の本文から書いたものです。
説明
Observation
Decoding writes every batch into freshly allocated buffers, and for large columns the first-touch page faults cost as much CPU as the decode itself. Scan of two fragments (50k rows, 11 GB of Arrow output) of 180 KB JSON strings, 64-core Zen 4, page cache warm, glibc malloc (pylance uses the system allocator):
| wall | CPU | page faults | perf |
|
|---|---|---|---|---|
| 2.2 per-value zstd, default | 7.1 s | 23 s | 5.4 M | 40% ZSTD_decompressSequences, ~45% kernel (clear_highpages, handle_mm_fault, _copy_to_iter) |
same with GLIBC_TUNABLES=glibc.malloc.hugetlb=1 |
2.0 s | 13.6 s | 0.59 M | |
| 2.0 uncompressed, default | 6.9 s | 16 s | ||
| same with hugetlb=1 | 2.4 s | 6.4 s |
5.4 M faults x 4 KiB is 22 GB for 11 GB of output, i.e. every output byte is faulted about twice (decode buffer, then the Arrow array built from it). MALLOC_MMAP_THRESHOLD_ / MALLOC_TRIM_THRESHOLD_ do not change it; THP does (#10524 documents the env var).
Suggestion
Either back large LanceBuffer allocations with madvise(MADV_HUGEPAGE) (or an allocator that does), or reuse decode output buffers across batches so pages are faulted once per scan instead of once per batch. Both would give the 2-3.5x above without asking users to set allocator tunables.
- 主要言語
- Rust
- スター
- 7.3k
- フォーク
- 929
- 平均マージ
- 2日 22時間
- マージ済み PR(30日)
- 572
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
lance-format/lance のほかの issue
-
bug(python): read_transaction raises TypeError on a Rewrite with rewritten indices対応中かも @Borg93 が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
lance-format/lance#11117 ·
メンテナーはふだん 2 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
lance-format/lance#10782 ·
メンテナーはふだん 2 日以内に返信
-
Upgrade DataFusion for the unparser stack-overflow fix再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
lance-format/lance#8225 ·
メンテナーはふだん 2 日以内に返信
-
enhancement
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
lance-format/lance#6425 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
-
Expose compute_pq_distance再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンenhancement
難易度 1/5 1〜3時間 初心者へのやさしさ 62/100
lance-format/lance#5675 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
lance-format/lance の issue をすべて見る
似ている issue
-
area:cli area:security bug priority:medium
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
status: new topic: ga4gh-sdk type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
comp-rbac
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
ClickHouse/ClickHouse#131875 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
googleworkspace/cli#984 ·
メンテナーはふだん 1 日以内に返信