-
Notifications
You must be signed in to change notification settings - Fork 409
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
Make performance of TPCH q15 stable #4570
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
@@ -226,6 +226,11 @@ void submitLocalDeltaMemory() | |||
local_delta = 0; | |||
} | |||
|
|||
Int64 getLocalDeltaMemory() | |||
{ | |||
return local_delta; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
local_delta
is thread-local, so different threads will see different deltas, is that what you expect?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
current_memory_usage = current_memory_tracker->get(); | ||
auto updated_local_delta_memory = CurrentMemoryTracker::getLocalDeltaMemory(); | ||
auto local_delta_memory_diff = updated_local_delta_memory - local_delta_memory; | ||
current_memory_usage += (local_memory_usage.fetch_add(local_delta_memory_diff) + local_delta_memory_diff); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
local_delta_memory_diff is added twice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, fetch_add
returns the value before added, so need to add it again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/merge |
@fzhedu: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger If you have any questions about the PR merge process, please refer to pr process. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
This pull request has been accepted and is ready to merge. Commit hash: 0f8e8ab
|
/merge |
@windtalker: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger If you have any questions about the PR merge process, please refer to pr process. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
@windtalker: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
Coverage for changed files
Coverage summary
full coverage report (for internal network access only) |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created: #4707. |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created: #4709. |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created: #4710. |
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei xufeixw@mail.ustc.edu.cn
What problem does this PR solve?
Issue Number: close #4451
Problem Summary:
What is changed and how it works?
Actually, there are 2 possible solutions
executeOnBlock
Aggregator::mergeAndConvertToBlocks
, check the result_size_bytes, and if it exceeds the threshold, convert all the hash table into two-level hash tableFor the first solution, converting hash table to two-level hash table can be done by each threads in the first stage of ParallelAggregating, and for the second solution, this converting things are executed in 1 threads.
I've done some test for both solutions, and found first solution has ~20% perfomance gain compared to the second solution for TPCH q15. So I choose the first solution.
Why not enable two-level hash table by default for all the cases:
Testing query:
select count(*),id from test group by id;
test
has 65536 rows, all rows have the sameid
, that is to say the above query return only 1 rowTesting cluster has only 1 TiFlash, and the cpu has 36 core, each query is running 1000 times.
Check List
Tests
Side effects
Documentation
Release note