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

Improve first() promise resolution to clean up any garbage references #36

Merged
merged 1 commit into from
Mar 22, 2023

Conversation

lucasnetau
Copy link
Contributor

Improve memory usage by removing listener reference on stream close and not triggering garbage collection cycles. This was found while debugging a large number of garbage collection cycles coming out of reactphp-child-process-pool.

Copy link
Member

@SimonFrings SimonFrings left a comment

Choose a reason for hiding this comment

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

Hey @lucasnetau, thanks for opening this up, always happy about contributions 👍

First up I want to say that I really like your pull request, it's not common that PRs have a quality like this, keep it up!

I executed the new tests you added locally without your fix and can confirm that they'll fail.
grafik

Nothing to add here, nice job 👍

Similar things done in reactphp/async#13, see for reference.

@WyriHaximus WyriHaximus added this to the v1.6.0 milestone Mar 20, 2023
Copy link
Member

@WyriHaximus WyriHaximus left a comment

Choose a reason for hiding this comment

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

Thank you for filing this, and all the other related PR's @lucasnetau 👍

@clue clue changed the title Remove cyclic reference causing garbage collection cycles Improve first() promise resolution to clean up any garbage references Mar 22, 2023
Copy link
Member

@clue clue left a comment

Choose a reason for hiding this comment

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

@lucasnetau Thank you for looking into this and filing this high-quality PR! Changes LGTM, keep it up! :shipit:

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

Successfully merging this pull request may close these issues.

None yet

4 participants