Skip to content

ColumnArrayT Append will move container data if it is right value#345

Merged
Enmk merged 5 commits into
ClickHouse:masterfrom
1261385937:master
Nov 16, 2023
Merged

ColumnArrayT Append will move container data if it is right value#345
Enmk merged 5 commits into
ClickHouse:masterfrom
1261385937:master

Conversation

@1261385937

@1261385937 1261385937 commented Nov 15, 2023

Copy link
Copy Markdown
Contributor

Optimize ColumnArrayT::Append() to allow underlying column (e.g. ColumnString) to 'steal' values if it has r-value overload of Append() to prevent excessive copying.

Comment thread clickhouse/columns/array.h Outdated
Comment thread clickhouse/columns/string.cpp

@Enmk Enmk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please write a motivation, expected performance effects (if any), etc. for this PR in a description.
Otherwise, it is hard to get the reason behind the proposed changes and whether or not these changes achieve the declared result.

@1261385937

Copy link
Copy Markdown
Contributor Author

Actually, we has 60+ column. Most of them are large string. we use this method:

void ColumnString::Append(std::string&& steal_value) 

rather than

void ColumnString::Append(std::string_view str)

So, ColumnArrayT Append can steal value is a better choice

@1261385937 1261385937 requested a review from Enmk November 15, 2023 14:23
Comment thread clickhouse/columns/array.h Outdated
@1261385937 1261385937 requested a review from Enmk November 16, 2023 02:02

@Enmk Enmk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Enmk Enmk merged commit 901f609 into ClickHouse:master Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants