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

[Enhancement] count memory usage of approx_top_k&percentile_cont agg state #49232

Merged
merged 13 commits into from
Aug 20, 2024

Conversation

silverbullet233
Copy link
Contributor

@silverbullet233 silverbullet233 commented Jul 31, 2024

Why I'm doing:

What I'm doing:

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function
  • This is a backport pr

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 3.3
    • 3.2
    • 3.1
    • 3.0
    • 2.5

be/src/exprs/agg/distinct.h Outdated Show resolved Hide resolved
be/src/exec/aggregator.cpp Outdated Show resolved Hide resolved
be/src/service/mem_hook.cpp Outdated Show resolved Hide resolved
Signed-off-by: silverbullet233 <[email protected]>
Signed-off-by: silverbullet233 <[email protected]>
This reverts commit 9c31a66.

Signed-off-by: silverbullet233 <[email protected]>
Signed-off-by: silverbullet233 <[email protected]>
Signed-off-by: silverbullet233 <[email protected]>
Signed-off-by: silverbullet233 <[email protected]>
Signed-off-by: silverbullet233 <[email protected]>
@silverbullet233 silverbullet233 changed the title [WIP][Enhancement] count memory usage of approx_top_k&percentile_cont agg state [Enhancement] count memory usage of approx_top_k&percentile_cont agg state Aug 13, 2024
Signed-off-by: silverbullet233 <[email protected]>
@kevincai kevincai removed request for a team August 13, 2024 05:25
Signed-off-by: silverbullet233 <[email protected]>
trueeyu
trueeyu previously approved these changes Aug 16, 2024
Signed-off-by: silverbullet233 <[email protected]>
Copy link

[Java-Extensions Incremental Coverage Report]

pass : 0 / 0 (0%)

Copy link

[FE Incremental Coverage Report]

pass : 0 / 0 (0%)

Copy link

[BE Incremental Coverage Report]

pass : 20 / 20 (100.00%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 be/src/exprs/agg/percentile_cont.h 6 6 100.00% []
🔵 be/src/exec/analytor.cpp 10 10 100.00% []
🔵 be/src/exec/aggregator.cpp 4 4 100.00% []

@@ -1187,6 +1196,7 @@ void Analytor::_find_candidate_peer_group_ends() {
}

void Analytor::_get_window_function_result(size_t frame_start, size_t frame_end) {
SCOPED_THREAD_LOCAL_AGG_STATE_ALLOCATOR_SETTER(_allocator.get());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_get_window_function_result will assign result for each rows.

// DO NOT put timer here because this function will be used frequently,
    // timer will cause a sharp drop in performance.

Will this cause a performance regression?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_get_window_function_result will assign result for each rows.

// DO NOT put timer here because this function will be used frequently,
    // timer will cause a sharp drop in performance.

Will this cause a performance regression?

No, in analytor, we just use MemHookAllocator, the logic is the same as before. there is no new timer introduced

@stdpain
Copy link
Contributor

stdpain commented Aug 20, 2024

since #49206 support count the memory usage from delta.
Can we consider just counting delta so that we don't need to care about how the specific function is implemented. No additional extensions would be needed either.

@silverbullet233 silverbullet233 merged commit 4411cb4 into StarRocks:main Aug 20, 2024
52 checks passed
@silverbullet233 silverbullet233 deleted the count_other_state_mem branch August 20, 2024 03:44
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.

3 participants