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

lib/membrane/core/bin/pad_controller.ex: refactored Enum to Stream #745

Closed

Conversation

bradhanks
Copy link
Contributor

No one asked me to but I refactored Membrane.Core.Bin.PadController. respond_links/2 to use Stream.
I enjoyed it as an exercise so feel free to just close this if you don't want it. :)

@bradhanks bradhanks requested a review from mat-hek as a code owner February 8, 2024 09:17
@mat-hek
Copy link
Member

mat-hek commented Feb 8, 2024

Hi @bradhanks, can you elaborate on what improvements does this change bring? ;)

@bradhanks
Copy link
Contributor Author

I'm going to assert that it marginally improves the application's performance and reduces memory usage, but really I have an unhealthy relationship with Stream.transform. :)

@mat-hek
Copy link
Member

mat-hek commented Feb 8, 2024

Streams can indeed reduce memory usage, but this usually comes at the cost of CPU consumption, because Streams have more computational overhead than Enums. However, as you pointed out, the performance change will be marginal in this case, and I don't like Stream.transform as much as you do, so I'm going to close this ;)

If you'd like to improve the core's performance, you should investigate the hot path, which includes sending, processing and receiving buffers and demands ;)

@mat-hek mat-hek closed this Feb 8, 2024
@bradhanks
Copy link
Contributor Author

Streams can indeed reduce memory usage, but this usually comes at the cost of CPU consumption, because Streams have more computational overhead than Enums. However, as you pointed out, the performance change will be marginal in this case, and I don't like Stream.transform as much as you do, so I'm going to close this ;)

If you'd like to improve the core's performance, you should investigate the hot path, which includes sending, processing and receiving buffers and demands ;)

That's great to know. Thanks for the feedback. 👍

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

Successfully merging this pull request may close these issues.

2 participants