Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

perf: use extend when buffering partition row indices in the native shuffle writer

已关闭 适合新手
#7,072 2 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 2 天内回复

@HarshilMital 已经在做这个了。

开始于 2026年10月17日。

  • #7097 来自 @Jbansal2 —— 未关闭

评估

难度
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 内容生成。

描述

area:shuffle enhancement good first issue performance requires-triage
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
派生
398
平均合并
2 天 22 小时
30 天内合并 PR
414

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

apache/datafusion-comet 的其他 Issue

查看 apache/datafusion-comet 的全部 Issue

相似的 Issue

更多 Scala Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。