Repository navigation
Optimize ColumnString::replicate and prevent memcpySmallAllowReadWriteOverflow15Impl from being optimized to built-in memcpy - #61075
Merged
Conversation
Contributor
|
This is an automated comment for commit be68b21 with description of existing statuses. It's updated for the latest CI running ⏳ Click here to open a full report in a separate page
Successful checks
|
Contributor
Author
|
Let's wait for performance-test report in CI. |
Contributor
Author
Contributor
Author
|
Tests based on sql: with 'clickhouse' as str
select arrayJoin(range(number % 10)), materialize(str) from numbers(100000000) format Null;
Before:
0 rows in set. Elapsed: 5.450 sec. Processed 100.00 million rows, 800.00 MB (18.35 million rows/s., 146.78 MB/s.)
Peak memory usage: 16.63 MiB.
After:
0 rows in set. Elapsed: 2.490 sec. Processed 100.00 million rows, 800.00 MB (40.16 million rows/s., 321.28 MB/s.)
Peak memory usage: 10.18 MiB. |
nickitat
approved these changes
Mar 15, 2024
Contributor
Author
Contributor
Author
Member
|
@taiyang-li Please merge with master. |
alexey-milovidov
approved these changes
Mar 21, 2024
opensource-fork-sync Bot
pushed a commit
to cla7aye15I4nd/opensource-ClickHouse__ClickHouse
that referenced
this pull request
Nov 13, 2026
…ed as paths, two readings of one input Blind reviews of the pull requests that introduced nine bugs fixed later (ported in ClickHouse#131294-ClickHouse#131302) showed these gaps: - Data the server wrote itself and reads back (parts, patch parts, packed-file indexes, `ssd_cache` files) was treated as trusted, so out-of-bounds reads on it were dismissed or rated as Nits (ClickHouse#126553, ClickHouse#116007, ClickHouse#86095). - No prompt for overflow of sizes computed from user-controlled counts (`ColumnString::replicate`, ClickHouse#61075). - No prompt for names read from data that become paths (packed archive index, ClickHouse#93414). - A security check that reads its input differently from the consumer (first vs last repeated key, Boolean spellings), which the real review of ClickHouse#106855 missed. Also ask for a separate pass over parsers and security decisions in large pull requests. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Optimize ColumnString::replicate and prevent memcpySmallAllowReadWriteOverflow15Impl from being optimized to built-in memcpy. Close #61074.
ColumnString::replicate speeds up by 2.46x on x86-64.
Benchmark is in https://github.com/bigo-sg/gluten/tree/b9580154365c09fd12057ba4e69cf3db03d1b7c3
Baseline:
Opt1: Calculate and allocate chars size in advance and avoid resize/push_back being called frequently
Opt2: Prevent memcpySmallAllowReadWriteOverflow15Impl from being optimized to built-in memcpy, which is slow in current scenerio
Reference: https://www.zhihu.com/question/647466901/answer/3422276125