Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

GC: optimize alloc of small object by keeping track of unused pages#2524

Merged
dlang-bot merged 1 commit intodlang:masterfrom
rainers:opt_alloc
Mar 29, 2019
Merged

GC: optimize alloc of small object by keeping track of unused pages#2524
dlang-bot merged 1 commit intodlang:masterfrom
rainers:opt_alloc

Conversation

@rainers
Copy link
Copy Markdown
Member

@rainers rainers commented Mar 26, 2019

This simple change is what yields the larger time difference of #2520 (comment), i.e. reduces execution time of the vdparser-test from approx. 10.5 s to 7.5 s.

@dlang-bot
Copy link
Copy Markdown
Contributor

Thanks for your pull request, @rainers!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub fetch digger
dub run digger -- build "master + druntime#2524"

uint* bPageOffsets;

// The small object pool uses the same array to keep a chain of pages with the same
// bin size and free pages (searchStart is first free page)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This comment is a bit premature, but keeping track of pages with the same bin size will be needed for deferring incremental recover into later allocations.

@kinke
Copy link
Copy Markdown
Contributor

kinke commented Mar 27, 2019

Rainer on fire ;) - the GC improvements are impressive (and at the same time kinda shocking that so much potential hasn't been exploited yet).

@PetarKirov
Copy link
Copy Markdown
Member

@rainers rebasing to master should fix the CircleCI build.

@rainers rainers force-pushed the opt_alloc branch 2 times, most recently from 4ee6b28 to 20a3788 Compare March 28, 2019 07:21
@rainers
Copy link
Copy Markdown
Member Author

rainers commented Mar 29, 2019

reduces execution time of the vdparser-test from approx. 10.5 s to 7.5 s.

BTW: time drops to about 5 seconds when compiling with LDC!

@kinke
Copy link
Copy Markdown
Contributor

kinke commented Mar 29, 2019

Is that so surprising? 30-40% runtime reduction with LDC seems like a rough rule of thumb for general code (probably more for number-crunching code), e.g., DMD itself.

@rainers
Copy link
Copy Markdown
Member Author

rainers commented Mar 29, 2019

Not really surprising, though profiling suggested that marking is pretty much memory bandwidth limited (most of the samples were taken at the instruction reading the scanned memory). LDC compiled marking code was better similar to the overall ratio which hints that there is still more leeway for improvement.

@dlang-bot dlang-bot merged commit 31fd6c0 into dlang:master Mar 29, 2019
@kinke
Copy link
Copy Markdown
Contributor

kinke commented Mar 29, 2019

[@rainers: Just as a reminder, -disable-gc2stack may be useful for comparisons with LDC.]

@rainers
Copy link
Copy Markdown
Member Author

rainers commented Mar 30, 2019

[@rainers: Just as a reminder, -disable-gc2stack may be useful for comparisons with LDC.]

Doesn't make a notable difference. The parser doesn't create many temporary objects AFAICT.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants