perf: use extend when buffering partition row indices in the native shuffle writer
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 78/100
- issue の種類
- リファクタリング
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- rust, spark
調査の方向性
置き換えるループは native/shuffle/src/partitioners/multi_partition.rs の MultiPartitionShuffleRepartitioner::buffer_partitioned_batch_may_spill にあります。ここでは reserve の呼び出しの後に、行ごとの push 呼び出しが続いています。まずこの関数を読み、cargo bench --bench shuffle_writer でベンチマークをビルドしてから、編集前にベースラインを保存してください。完了の条件は、ループが同じタプルに対する extend に置き換えられていること、ベンチマークがベースラインと比較されていること、そして結果がノイズの範囲内であっても報告されていることです。
索引モデルが issue の本文から書いたものです。
説明
What is the problem the feature request solves?
MultiPartitionShuffleRepartitioner::buffer_partitioned_batch_may_spill in native/shuffle/src/partitioners/multi_partition.rs pushes the row indices of each partition one at a time after reserve:
indices.reserve(row_indices.len());
for row_idx in row_indices {
indices.push((buffered_partition_idx, *row_idx));
}
Vec::push re-checks capacity on every iteration. indices.extend(row_indices.iter().map(|&r| (buffered_partition_idx, r))) gets the trusted-length specialization and writes the tuples in one pass.
Describe the potential solution
Replace the loop with extend. Run cargo bench --bench shuffle_writer before and after (save a baseline with --save-baseline before); the change is small, so report the result either way and drop it if it is within noise.
Additional context
Micro item from #5002, carried into #5905. Good first issue.
- 主要言語
- Scala
- スター
- 1.3k
- フォーク
- 391
- 平均マージ
- 2日 12時間
- マージ済み PR(30日)
- 432
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/datafusion-comet のほかの issue
-
Native hashing of NullType and ANSI interval values fails with "Unsupported data type in hasher"対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンarea:expressions area:shuffle bug priority:high requires-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
apache/datafusion-comet#7063 ·
メンテナーはふだん 1 日以内に返信
-
area:shuffle bug priority:high requires-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
apache/datafusion-comet#7062 ·
メンテナーはふだん 1 日以内に返信
-
requires-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
apache/datafusion-comet#7001 ·
メンテナーはふだん 1 日以内に返信
-
Extract shared list-array construction from the split_* functions in split.rs対応中かも @arminazimi が 2 日前に担当しました。 オープンarea:expressions enhancement good first issue help wanted requires-triage rust tech debt
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
apache/datafusion-comet#6983 ·
メンテナーはふだん 1 日以内に返信
-
Deduplicate spark_ceil and spark_floor and port floor's decimal boundary tests to ceil対応中かも @med9110 が 2 日前に担当しました。 オープンarea:expressions enhancement help wanted requires-triage rust tech debt
難易度 2/5 半日 初心者へのやさしさ 68/100
apache/datafusion-comet#6974 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
apache/datafusion-comet の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
scalameta/metals-zed#99 ·
-
Bound wrong-magic P2P diagnostics to parsed header bytes対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
ergoplatform/ergo#2736 ·
メンテナーはふだん 1 日以内に返信
-
bug 🐞 CI/CD ⚒️
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
valkey-io/valkey-glide#7370 ·
メンテナーはふだん 1 日以内に返信
-
Improve UI text on confirmation page (at registration)対応中かも @Arghyann が 1 日前に担当しました。 オープンgood first issue improvement
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
lichess-org/lila#22126 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
[VL] Remove the unused ShuffleSchema.h対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
メンテナーはふだん 2 日以内に返信