apache / apache/arrow

Hotspot on ~Status()

Open
#47,774 3 comments 0 reactions 0 assignees View on GitHub
Component: C++ Type: enhancement
Dominant language
C++
Stars
17.1k
Forks
4.3k
Avg merge
3d 13h
Merged PRs (30d)
88

Description

### Describe the enhancement requested

I use apache arrow to read some parquets (tpch lineitem table, about 25millon rows),
observed hotspot on ~Status() method by intel Vtune,
then I try to inline it use ARROW_FORCE_INLINE, **faster 15% stably**
before:
` ~Status() noexcept {
if (ARROW_PREDICT_FALSE(state_ != NULL)) {
if (!state_->is_constant) {
DeleteState();
}
}
}`
after:
` ARROW_FORCE_INLINE ~Status() noexcept {
if (ARROW_PREDICT_FALSE(state_ != NULL)) {
if (!state_->is_constant) {
DeleteState();
}
}
}`

so, is this a suitable optimization in all cases? any problems with it?

### Component(s)

C++

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.