Skip to content
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

Reduce allocations #7365

Merged
merged 4 commits into from
Sep 24, 2022
Merged

Reduce allocations #7365

merged 4 commits into from
Sep 24, 2022

Conversation

shawjef3
Copy link
Contributor

This branch significantly reduces allocations in the runtime. The following shows allocations for ZIO.unit.forever before the commits and then after. Note that after the changes, scala.runtime.ObjectRef and scala.runtime.IntRef no longer appear on the list of top allocations.

I got the measurement by doing memory profiling with VisualVM, setting the profiled classes to *, and disabling Track only live objects.

series-2 x
reduce-allocations

@jdegoes
Copy link
Member

jdegoes commented Sep 24, 2022

@shawjef3 Awesome catch. Did you get all of the cur = ??? usages in the run loop or are there any more left??

@shawjef3
Copy link
Contributor Author

@jdegoes I did minimal changes to make the boxing go away. There's some cur = if uses remaining, but no cur = try. I can remove them if you like.

@jdegoes
Copy link
Member

jdegoes commented Sep 24, 2022

@shawjef3 If you have the interest and time, I'd love to see them all go away!

@jdegoes jdegoes merged commit 9cb41ca into zio:series/2.x Sep 24, 2022
@shawjef3
Copy link
Contributor Author

@jdegoes definitely interested. #7366

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants