Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 5 commits into from
Nov 16, 2023
Merged

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

merged 5 commits into from
Nov 16, 2023

Conversation

1261385937
Copy link
Contributor

@1261385937 1261385937 commented Nov 15, 2023

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.

clickhouse/columns/array.h Outdated Show resolved Hide resolved
Copy link
Collaborator

@Enmk Enmk left a comment

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
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
clickhouse/columns/array.h Outdated Show resolved Hide resolved
@1261385937 1261385937 requested a review from Enmk November 16, 2023 02:02
Copy link
Collaborator

@Enmk Enmk left a comment

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
16 checks passed
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