-
Notifications
You must be signed in to change notification settings - Fork 594
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
drt: Contiguous GC data #6016
base: master
Are you sure you want to change the base?
drt: Contiguous GC data #6016
Conversation
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.
clang-tidy made some suggestions
@osamahammad21 Have you had a chance to look at this? |
Please cleanup the clang-tidy warnings |
clang-tidy review says "All clean, LGTM! 👍" |
I am still looking into the PR but I don't understand the need for the dynarray class. Is it just a container for the std::vector? Why is it better than just using std::vector directly? |
I have concerns about the |
I should've outline some of this in the description, apologies. The whole point of As for a longer term motive, this is a change to the structure of a small subset of the data that DRT operates on. One could apply similar changes to the rest of the data, and stack these speedups. I get that you use polymorphism and you like it, but I encourage you to reconsider using it everywhere. It's dynamic in some ways, but static and constraining in others. Not to mention it requires pointer chasing and fragmented memory access. Can you point out what problems it solves for you? I also fail to see how arrays of pointers are more intuitive than just arrays. |
db2ef38
to
a2a6d8d
Compare
clang-tidy review says "All clean, LGTM! 👍" |
a2a6d8d
to
78e43ba
Compare
clang-tidy review says "All clean, LGTM! 👍" |
7b2f473
to
af0a213
Compare
src/drt/src/gc/FlexGC_impl.h
Outdated
Arena<gcNet> netArena_ = {128}; | ||
Arena<gcPin> pinArena_ = {512}; | ||
Arena<gcRect> rectArena_ = {512}; | ||
Arena<gcSegment> segmentArena_ = {512}; | ||
Arena<gcCorner> cornerArena_ = {512}; |
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.
any comment why these exact block sizes?
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 particular reason. The new version I just pushed I tested empirically. It's around the optimum for the systems I tested on.
@kbieganski Do you still get the same speedup with the arena data structure? |
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.
clang-tidy made some suggestions
af0a213
to
04b9a31
Compare
Yes, it's about 3.5% for |
04b9a31
to
d528d7a
Compare
clang-tidy review says "All clean, LGTM! 👍" |
d528d7a
to
423a8b2
Compare
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.
clang-tidy made some suggestions
Signed-off-by: Krzysztof Bieganski <[email protected]>
423a8b2
to
3538a26
Compare
clang-tidy review says "All clean, LGTM! 👍" |
@osamahammad21 What do you think about this approach? |
Arena appears to be not much different than std::deque. It doesn't support deallocation except as a whole. It makes the memory management less clear as we have to ensure nobody tries to delete such an arena returned pointer. Are you seeing more than 3% gain in private testing? If not I don't find the complexity runtime tradeoff compelling. |
It allocates bigger chunks (technically depending on
That's a big plus if you know the lifetime of your data. And you know it in this situation.
On
No, but if you apply similar changes to other places, I believe it'll add up. I'll try a bigger design.
I would argue it's a matter of familiarity rather than complexity. And arenas are a well-documented concept, shouldn't be too difficult to bring devs up to speed. |
Store some of the GC data in contiguous arrays. The last commit is to ensure no one pushes to these vectors, as other code references this data via pointers, so we cannot invalidate them.
asap7/aes
drt-contiguous-gc
asap7/ibex
drt-contiguous-gc