Skip to content

Check effect of shrinking on non-moving collector #441

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

Closed
treeowl opened this issue Apr 25, 2022 · 7 comments
Closed

Check effect of shrinking on non-moving collector #441

treeowl opened this issue Apr 25, 2022 · 7 comments

Comments

@treeowl
Copy link
Collaborator

treeowl commented Apr 25, 2022

When the non-moving garbage collector is in use, each shrink operation has to do some funny business to support it. How expensive is this? Is it expensive enough to justify cloning instead, especially for very small arrays?

@treeowl
Copy link
Collaborator Author

treeowl commented Apr 25, 2022

@bgamari, your input would be very much appreciated.

@sjakobi
Copy link
Member

sjakobi commented Apr 25, 2022

To provide a single datapoint: The 8% speedup as a result of using shrink in filterMapAux (#433) was measured with -nonmoving-gc:

if impl(ghc >= 8.10)
ghc-options: "-with-rtsopts=-A32m --nonmoving-gc"

When the non-moving garbage collector is in use, each shrink operation has to do some funny business to support it.

Roughly what is this funny business? I'm very unfamiliar with how the non-moving GC works.

@treeowl
Copy link
Collaborator Author

treeowl commented Apr 25, 2022

Roughly, I have no idea. I just saw calls to some functions or macros in the cmm definition of the shrinking primop. How did it do with the copying collector?

@sjakobi
Copy link
Member

sjakobi commented Apr 25, 2022

How did it do with the copying collector?

I didn't try that. Something like cabal run benches -- -p filterWithKey --stdev 0.5 should do the trick.

@treeowl
Copy link
Collaborator Author

treeowl commented Apr 25, 2022

It would be interesting to see, but shrinking is pretty much totally free with that collector, so I imagine the improvements would be even larger.

@treeowl
Copy link
Collaborator Author

treeowl commented Apr 30, 2022

If the code was faster than before when you tested with the non-moving collector, I think we can close this.

@sjakobi
Copy link
Member

sjakobi commented May 8, 2022

Alright.

@sjakobi sjakobi closed this as completed May 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants