-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[opt](memory) Optimize PODArray memory tracking performance #52553
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
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
|
run buildall |
TPC-H: Total hot run time: 33872 ms |
TPC-DS: Total hot run time: 184665 ms |
ClickBench: Total hot run time: 29.96 s |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
|
run buildall |
TPC-H: Total hot run time: 33616 ms |
TPC-DS: Total hot run time: 185452 ms |
ClickBench: Total hot run time: 29.28 s |
3082a19 to
0e4882b
Compare
|
run buildall |
0e4882b to
3f2b45e
Compare
TPC-H: Total hot run time: 42597 ms |
3f2b45e to
d4ba0ed
Compare
|
run buildall |
d4ba0ed to
084ea2e
Compare
TPC-H: Total hot run time: 33403 ms |
TPC-DS: Total hot run time: 186616 ms |
ClickBench: Total hot run time: 29.33 s |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
|
run buildall |
TPC-H: Total hot run time: 33819 ms |
TPC-DS: Total hot run time: 186104 ms |
ClickBench: Total hot run time: 32.85 s |
TPC-DS: Total hot run time: 189793 ms |
ClickBench: Total hot run time: 32.77 s |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
|
run buildall |
TPC-H: Total hot run time: 34417 ms |
TPC-DS: Total hot run time: 189413 ms |
ClickBench: Total hot run time: 32.49 s |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
08920ac to
6b6ea35
Compare
|
run buildall |
TPC-H: Total hot run time: 34599 ms |
TPC-DS: Total hot run time: 191119 ms |
ClickBench: Total hot run time: 33.03 s |
|
run buildall |
702549d to
48eb3f2
Compare
|
run buildall |
TPC-H: Total hot run time: 34541 ms |
TPC-DS: Total hot run time: 189136 ms |
ClickBench: Total hot run time: 32.86 s |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
wangbo
left a comment
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
…2553) ### What problem does this PR solve? apache#50549 may cause performance loss If capacity_bytes <= 256K, res_mem_growth = c_end_of_storage - c_res_mem. If capacity >= 512K: - If `c_end_of_storage - c_res_mem < TrackingGrowthMinSize`, then tracking to c_end_of_storage. - `c_end_new - c_res_mem` is the size of the physical memory growth, which is also the minimum tracking size of this time, `(((c_end_new - c_res_mem) >> 16) << 16)` is aligned down to 64K, assuming `capacity_bytes >= 512K`, so `(capacity_bytes >> 3)` is at least 64K, so `(((c_end_new - c_res_mem) >> 16) << 16) + (capacity_bytes() >> 3)` must be greater than `c_end_new - c_res_mem`. For example: - 256K < capacity <= 512K, it will only tracking twice, the second time `c_end_of_storage - c_res_mem < TrackingGrowthMinSize` is true, so it will tracking to c_end_of_storage. - capacity > 32M, `(((c_end_new - c_res_mem) >> 16) << 16)` align the increased physical memory size down to 64k, then add `(capacity_bytes() >> 3)` equals 2M, so `reset_resident_memory` is tracking an additional 2M, after that, physical memory growth within 2M does not need to reset_resident_memory again. so, when PODArray is expanded by power of 2, the memory is checked and tracked up to 8 times between each expansion, because each time additional tracking `(capacity_bytes() >> 3)`. after each reset_resident_memory, tracking_res_memory >= used_bytes;
What problem does this PR solve?
#50549 may cause performance loss
If capacity_bytes <= 256K, res_mem_growth = c_end_of_storage - c_res_mem.
If capacity >= 512K:
- If
c_end_of_storage - c_res_mem < TrackingGrowthMinSize, then tracking to c_end_of_storage.-
c_end_new - c_res_memis the size of the physical memory growth,which is also the minimum tracking size of this time,
(((c_end_new - c_res_mem) >> 16) << 16)is aligned down to 64K,assuming
capacity_bytes >= 512K, so(capacity_bytes >> 3)is at least 64K,so
(((c_end_new - c_res_mem) >> 16) << 16) + (capacity_bytes() >> 3)must be greater than
c_end_new - c_res_mem.so, when PODArray is expanded by power of 2,
the memory is checked and tracked up to 8 times between each expansion,
because each time additional tracking
(capacity_bytes() >> 3).after each reset_resident_memory, tracking_res_memory >= used_bytes;
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)