-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Small FlatMap optimization with default initialization #2620
Open
chenBright
wants to merge
2
commits into
apache:master
Choose a base branch
from
chenBright:opt_flat_map
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chenBright
force-pushed
the
opt_flat_map
branch
7 times, most recently
from
April 27, 2024 16:58
d95b54c
to
b59d76d
Compare
chenBright
force-pushed
the
opt_flat_map
branch
3 times, most recently
from
April 27, 2024 17:27
2556087
to
dcdf77f
Compare
Because the usage difference with std::map, FlatMap is unfriendly to use. |
There are some unknown crash issues. This PR will be opened after these issues are resolved. |
chenBright
force-pushed
the
opt_flat_map
branch
13 times, most recently
from
June 23, 2024 18:36
62db1f9
to
34a1429
Compare
chenBright
force-pushed
the
opt_flat_map
branch
10 times, most recently
from
June 24, 2024 03:56
410b67c
to
0426dc9
Compare
chenBright
force-pushed
the
opt_flat_map
branch
2 times, most recently
from
August 3, 2024 17:35
96841c6
to
3ac6e31
Compare
chenBright
force-pushed
the
opt_flat_map
branch
from
October 2, 2024 04:07
3ac6e31
to
0077fa2
Compare
chenBright
force-pushed
the
opt_flat_map
branch
7 times, most recently
from
November 1, 2024 15:51
a3e0668
to
614f82e
Compare
chenBright
force-pushed
the
opt_flat_map
branch
from
November 2, 2024 05:52
614f82e
to
2d31dbc
Compare
@wwbmmm 有空看看 |
对FlatMap的性能有影响吗? |
没有影响。理论上来说,内联的内存块对cache更优化。 |
LGTM |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
Issue Number:
Problem Summary:
目前FlatMap需要二段式构造:构造函数+init函数。这种构造方式很容易用错,甚至出core,所以使用上必须小心翼翼,体验不好。
What is changed and the side effects?
Changed:
FlatMap构造函数结束即完成初始化。使用sso、IOBuf::SmallView的策略,初始化_buckets和_thumbnail使用内联的内存块,没有init函数中Alloc失败的顾虑。后续可以不用调init进行初始化,可以只在需要桶数比较大或者修改load factor才调init。即使init失败了,FlatMap还是可以正常使用的。
Side effects:
Performance effects(性能影响):
Breaking backward compatibility(向后兼容性):
Check List: