Repository navigation
Use a short String payload and fewer run lengths in the sparse_column_index_runs performance test - #129399
Use a short String payload and fewer run lengths in the sparse_column_index_runs performance test#129399groeneai wants to merge 3 commits into
sparse_column_index_runs performance test#129399Conversation
Queries ClickHouse#3-ClickHouse#5 of this test were noisy on amd: in 16-36% of master jobs the two servers' medians differed by more than 10%, while each server stayed at its own level for the whole job (in-run CV ~2%). The level belongs to the server process, not the binary or the data. CI's own CPU profiles of the slower server attribute 85% of its extra samples to memcpy inside jemalloc realloc, 94% of it growing the chars of the String result of ColumnSparse::index (ColumnString::insertManyFrom -> PODArray realloc). With a 385-448 byte payload every 65409-row output block materializes ~1.26 MB of chars, grown by doubling; whether jemalloc can grow such an allocation in place depends on the process's heap layout, so a process is fast or slow for its whole life. toString(number) keeps the same tables, rows, sparse layout and run structure, and both String and UInt64 still go through the run path of ColumnSparse::index; only the bytes copied per String value shrink. Related: ClickHouse#100759 Related: ClickHouse#118237 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
cc @egor-click, could you review this and add the @fallintoplace, the values are now |
|
Workflow [PR], commit [fbcedfe] Summary: ✅
AI ReviewSummaryThis PR reduces noise in Final VerdictStatus: ✅ Approve |
Algunenano
left a comment
There was a problem hiding this comment.
@groeneai Looks good, but do we need 6 different run_length values? It might make sense to drop some of them if they are testing the same thing
Run length 1 is the only one that takes the single-row insertFrom path of ColumnSparse::index. Every length from 2 to 64 takes the same run path (one value lookup and one insertManyFrom per run) and differs only in how many output rows share a run, which master CI shows as a smooth curve (amd medians 117 / 81 / 58 / 49 / 35 ms for 2 / 4 / 8 / 16 / 64). Keep the shortest and the longest run next to the control and drop 4, 8 and 16. Queries #0 and ClickHouse#1 keep their index and text; run length 64 moves from ClickHouse#5 to ClickHouse#2. Co-Authored-By: Claude Opus 5.5 <[email protected]>
sparse_column_index_runs performance testsparse_column_index_runs performance test
|
No. Only |
|
we have only test and query number for historical results, if we start deleting tests, all query numbers will change and all history we have will be thrown into trash i don’t like that, @groeneai , this is a solution made in a hurry that will break more than it will improve i think that we need a way to mark queries disabled,stale so they don't run and only append new queries or create new tests and never change or delete |
|
Understood. Here the payload change keeps every query number; the only renumbering is b462a98, which dropped run lengths 4, 8 and 16 at @ Algunenano's request and moved 64 from #5 to #2. I can revert that commit so no number moves, or keep it, and I won't push to this PR until you and @ Algunenano agree. A |
|
@egor-click We modify bad performance tests all the time. Keeping a bad test history does not make sense. We also constantly remove / add new queries in existing performance tests, so keeping improvements behind the idea of having a perfect history is not even a reality today. Let's drop bad unnecessary tests. If we need history, why not use the hash of the query instead of comparing test file + query number? |
|
Let's wait until @egor-click reworks the history before changing any performance tests queries. We can fix other things (like preventing new bad tests being included in the meantime) |
Related: #100759
Related: #118237
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
The
sparse_column_index_runsperformance test uses shortStringvalues, so its queries no longer run at a different speed on each of the two servers of a comparison, and it keeps run lengths 1, 2 and 64 only.Description
sparse_column_index_runs#3-#5 (run lengths 8, 16, 64) are noisy on amd: from 2026-10-25 to 11-04 the two servers' medians differed by more than 10% in 26%, 36% and 17% of master jobs (arm: under 1%). Example: amd_release 1/6. Each server keeps its own level for the whole job (in-run CV ~2%); the same binary gives uncorrelated levels in consecutive jobs (r = -0.01 over 457 shas).CI's own CPU profiles of the slower server put 85% of its extra samples in
memcpyinside jemallocrealloc, 94% of them growing the chars of theStringresult ofColumnSparse::index(ColumnString::insertManyFrom); per job, the difference in that share predicts the time ratio (r = 0.81). With the 385-448 byte payload every 65409-row output block builds ~1.26 MB of chars by doubling, and whether jemalloc can grow it in place depends on the process's heap layout.The payload is now
toString(number)(1-7 bytes), so a block's chars fit in one 32 KiB allocation. Tables, rows and sparse layout are unchanged, and both columns still take the run path.Run lengths 4, 8 and 16 are removed: only run length 1 takes the single-row
insertFrompath, and 2 to 64 all take the same run path (one lookup and oneinsertManyFromper run), differing only in rows per run. Run length 64 moves from #5 to #2, so it is judged at the 0.15 floor until its new key has history.Validation: two local servers, official master
amd_releasebinary, CI config and pinning, 12 fresh processes per variant. Old: CV of the per-process medians 4.7% / 8.6% / 4.5% for #3-#5. New: 1.5% / 1.0% / 1.4%, no server pair over 2.5% apart.perf.pyruns the new file with rc 0, and its queries are byte-identical to the old #0, #1, #5.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/129399]