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

Use Microsoft.IO.RecyclableMemoryStream #16946

Closed
adamradocz opened this issue Nov 3, 2024 · 4 comments · Fixed by #16949
Closed

Use Microsoft.IO.RecyclableMemoryStream #16946

adamradocz opened this issue Nov 3, 2024 · 4 comments · Fixed by #16949
Milestone

Comments

@adamradocz
Copy link
Contributor

Is your feature request related to a problem?

No.

Describe the solution you'd like

In the code, new MemoryStream()s could be optimized with pooling by using the Microsoft.IO.RecyclableMemoryStream nuget.

@hishamco
Copy link
Member

hishamco commented Nov 3, 2024

I noticed that you suggested this in Oqtane Framework too :) I just read about the RecyclableMemoryStream I never mind letting you push a PR if @sebastienros has no objection

Copy link
Contributor

github-actions bot commented Nov 3, 2024

Thank you for submitting your first issue, awesome! 🚀 We're thrilled to receive your input. If you haven't completed the template yet, please take a moment to do so. This ensures that we fully understand your feature request or bug report. On what happens next, see the docs.

MikeAlhayek added a commit that referenced this issue Nov 4, 2024
Fix #16946

Related Work Items: #169
@sebastienros
Copy link
Member

I am very familiar with RecyclableMemoryStream and find it very well-done. I personally use it as an IBufferWriter which is supports too (not just Stream).

From the PR I see we use MemoryStream mostly with existing arrays. In that case MemoryStream is not allocating anything so using the RMS is useless, assuming we are not adding more data to the stream.

However there might be other places where we don't use MemoryStream explicitly and could benefit from this library, like template generation. Let's see...

@MikeAlhayek MikeAlhayek added this to the 2.x milestone Nov 4, 2024
Copy link
Contributor

github-actions bot commented Nov 4, 2024

We triaged this issue and set the milestone according to the priority we think is appropriate (see the docs on how we triage and prioritize issues).

This indicates when the core team may start working on it. However, if you'd like to contribute, we'd warmly welcome you to do that anytime. See our guide on contributions here.

@MikeAlhayek MikeAlhayek modified the milestones: 2.x, 2.1 Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants