Skip to content

[optimization] avoid extra memory copy while build hash table - #5301

Merged
morningman merged 3 commits into
apache:masterfrom
stdpain:optimize_hash_table_build
Jan 30, 2021
Merged

[optimization] avoid extra memory copy while build hash table#5301
morningman merged 3 commits into
apache:masterfrom
stdpain:optimize_hash_table_build

Conversation

@stdpain

Copy link
Copy Markdown
Contributor

Proposed changes

avoid extra memory copy while build hash table

reference to #5300

Types of changes

  • [] Bugfix (non-breaking change which fixes an issue)
  • [] New feature (non-breaking change which adds functionality)
  • [] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [] Documentation Update (if none of the other choices apply)
  • Code refactor (Modify the code structure, format the code, etc...)

Checklist

  • I have created an issue on (Fix #ISSUE) and described the bug/feature there in detail
  • Compiling and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • Any dependent changes have been merged

Further comments

This modification may have a performance improvement of more than 25% during the hash table construction phase.

@stdpain
stdpainforce-pushed the optimize_hash_table_build branch from 7b86ef7 to 4c102eaCompareJanuary 26, 2021 06:00
Comment threadbe/src/exec/hash_table.hpp
Comment threadbe/src/exec/hash_table.cpp
Comment threadbe/src/exec/hash_table.h
Comment threadbe/src/exec/hash_table.cpp Outdated
Comment threadbe/src/exec/hash_table.hpp Outdated
// Buffer to store node data.
uint8_t* _current_nodes;
// number of nodes stored (i.e. size of hash table)
int64_t _num_nodes;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
int64_t_num_nodes;
int64_t_total_used;

Easier to understand

stdpainand others added 2 commits January 28, 2021 10:54
Co-authored-by: wangbo <506340561@qq.com>

@yangzhgyangzhg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@wangbowangbo added the area/sql/execution Issues or PRs related to the execution engine label Jan 28, 2021

@wangbowangbo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

+1

@morningman
morningman merged commit bf0cb78 into apache:masterJan 30, 2021
@yangzhgyangzhg mentioned this pull request Feb 9, 2021
@stdpain
stdpain deleted the optimize_hash_table_build branch February 21, 2021 17:01
EmmyMiao87 pushed a commit to EmmyMiao87/incubator-doris that referenced this pull request Apr 21, 2021
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/sql/executionIssues or PRs related to the execution engine

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@stdpain@yangzhg@wangbo@morningman