[Feature] Improve scan performance in hot read paths
@gripleaf 已经在做这个了。
开始于 2026年9月21日。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 活跃
- 技术栈
- cpp
- 领域
- performance
调研方向
首先,对并发扫描路径中 manifest reader 的 StructArray::fields() 调用和 Avro decoder 的 ArrayBuilder::type() 调用进行性能分析。确定适用于不可变 Arrow 元数据的 batch、reader 或 builder 生命周期,然后验证在相应的 Arrow 对象树被替换时缓存会失效。完成的标准是,在并发扫描期间降低 shared-pointer 同步和引用计数的开销。
由索引模型根据 Issue 内容生成。
描述
Search before asking
- I searched in the issues and found nothing similar.
Motivation
Recent profiling of highly concurrent scans has revealed several performance bottlenecks caused by
repeated operations on Arrow-returned shared_ptr objects in hot read loops.
Two significant cases have been identified:
-
Manifest readers repeatedly call
StructArray::fields()while processing individual rows. This
copiesshared_ptr<Array>objects and, with GCC 8.3's libstdc++, can introduce substantial lock
contention through_Sp_locker,pthread_mutex_lock, and futex waits when multiple workers read
manifests concurrently. -
Avro decoding calls
ArrayBuilder::type()for every integer and timestamp value. Because this
method returnsstd::shared_ptr<DataType>by value, concurrent scans repeatedly modify reference
counts on shared Arrow primitive data types, causing cache-line contention. Profiling showed
ArrayBuilder::type()and shared-pointer release operations accounting for a large proportion of
samples after the manifest bottleneck was removed.
This issue tracks the broader effort to identify and eliminate similar shared-pointer operations
from scan hot paths. The goal is to cache immutable Arrow metadata at an appropriate batch, reader,
or builder lifetime, while ensuring caches are invalidated whenever the corresponding Arrow object
tree is replaced.
The expected outcome is lower synchronization and reference-counting overhead under concurrent
scans, allowing CPU time to return to actual decoding, memory copying, and buffer management.
Solution
No response
Anything else?
No response
Are you willing to submit a PR?
- I'm willing to submit a PR!
- 主要语言
- C++
- 星标
- 65
- 派生
- 29
- 平均合并
- 2 天 4 小时
- 30 天内合并 PR
- 78
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/paimon-cpp 的其他 Issue
-
enhancement
apache/paimon-cpp#381 · 已指派 1 人 ·
-
难度 4/5 3-5 天 新手友好度 30/100
apache/paimon-cpp#375 · 已指派 1 人 ·
-
enhancement
难度 5/5 一周以上 新手友好度 45/100
apache/paimon-cpp#361 · 已指派 1 人 ·
-
enhancement
难度 4/5 3-5 天 新手友好度 45/100
apache/paimon-cpp#325 · 已指派 1 人 ·
-
enhancement
难度 5/5 一周以上 新手友好度 35/100
apache/paimon-cpp#319 · 1 个 reaction · 已指派 1 人 ·
查看 apache/paimon-cpp 的全部 Issue
相似的 Issue
-
ai_reviewed
难度 2/5 1-3 小时 新手友好度 68/100
ydb-platform/ydb#53869 · 3 条评论 ·
-
bug cert blocker needs triage
难度 2/5 1-3 小时 新手友好度 82/100
project-chip/connectedhomeip#74373 ·
-
upstream update
难度 2/5 1-3 小时 新手友好度 75/100
conan-io/conan-center-index#31035 ·
-
Bug
难度 2/5 1-3 小时 新手友好度 68/100
-
documentation
难度 1/5 1 小时以内 新手友好度 85/100
vllm-project/vllm-ascend#17329 ·