-
Notifications
You must be signed in to change notification settings - Fork 126
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 RecyclableMemoryStream instead of MemoryStream #133
Conversation
3db795e
to
6f9ebbd
Compare
fcc0b85
to
29a419c
Compare
Some notes:
I made some final touches and now it is good for review. |
29a419c
to
781367b
Compare
Just a final final touch:
|
Thanks @Odonno for a nicely prepared PR, I'm going to review it |
df86961
to
84ebd4a
Compare
Hi @Marfusios Thank you for your effort. I resolved the conflicts after your changes. Mostly nullable reference types. Not sure if I am 100% compliant on this topic. Will make some check later to see if it works as expected. |
Since you upgraded to .NET Standard 2.1, I removed pragma conditions for .NET Standard 2.0. |
Hi @Marfusios When do you think you can review this PR? |
Bitte um unterstützung beim verifizieren der Dockomente Mit freundlichen
gruß Kresse Andreas
Am Di., 3. Okt. 2023 um 19:47 Uhr schrieb David Bottiau <
***@***.***>:
… Hi @Marfusios <https://github.com/Marfusios>
When do you think you can review this PR?
—
Reply to this email directly, view it on GitHub
<#133 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A527QUGF4LXYEBP3NLFIC33X5RFR7AVCNFSM6AAAAAA3JA4IEOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBVGQ2DKNBUG4>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Hey, finally got to it, thanks for the PR, looks good to me from here, will test it locally after the merge and do some slight polishing |
What is done on this PR:
RecyclableMemoryStreamManager
from theMicrosoft.IO.RecyclableMemoryStream
to recycleMemoryStream
instead of having extensive use of the Garbage Collector. More info here: https://github.com/microsoft/Microsoft.IO.RecyclableMemoryStreamI have a benchmark in place for a project I am working on. Here are the result benchmarks.
Before:
After:
I put the
HttpWithClientFactory
in reference because it should have a very close performance impact toWsText
. CPU time and memory allocation are reduced by 80%-120%. Of course, it depends on the use case. For some scenarii, there are absolutely no impact (small batch, few/no data consumption).