-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 #16949
base: main
Are you sure you want to change the base?
Use RecyclableMemoryStream #16949
Conversation
I was waiting for Seb reply on the issue to let the author propose the PR, but seems you do it quickly :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am very familiar with this API and I don't think we have many actual usages of it. At least not by replacing where we already use MemoryStream, I can explain at Tuesday's meeting.
...rchardCore.Infrastructure/Shells.Database/Configuration/DatabaseShellConfigurationSources.cs
Outdated
Show resolved
Hide resolved
...re/OrchardCore.Infrastructure/Shells.Database/Configuration/DatabaseShellsSettingsSources.cs
Outdated
Show resolved
Hide resolved
test/OrchardCore.Tests/Localization/PortableObjectStringLocalizerTests.cs
Show resolved
Hide resolved
src/OrchardCore/OrchardCore.Infrastructure/Scripting/Files/FilesScriptEngine.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore/OrchardCore.Infrastructure/Documents/DefaultDocumentSerializer.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore/OrchardCore.Infrastructure/Documents/DefaultDocumentSerializer.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore/OrchardCore.Infrastructure/Documents/DefaultDocumentSerializer.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore/OrchardCore.Infrastructure.Abstractions/MemoryStreamFactory.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments but LGTM
@@ -11,7 +12,7 @@ public async Task<string> GetTextAsync(string path, Stream fileStream) | |||
// https://github.com/UglyToad/PdfPig/blob/master/src/UglyToad.PdfPig.Core/StreamInputBytes.cs#L45. | |||
// Thus if it isn't, which is the case with e.g. Azure Blob Storage, we need to copy it to a new, seekable | |||
// Stream. | |||
MemoryStream seekableStream = null; | |||
RecyclableMemoryStream seekableStream = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should think about copying the stream on the file system instead of memory. #16955
@@ -0,0 +1,11 @@ | |||
using Microsoft.IO; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have an actual infrastructure package that is no "abstractions" or a common project where we put helpers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is Infrastructure
project. but not all of these projects depend on Infrastructure
they depend on
Infrastructure.Abstractions` I am also not happy to add this to the abstraction project. I am open to better placement.
Fix #16946
@sebastienros I am carious to see is RecyclableMemoryStream will have an impact on the project. If you have time to do a comparison that would be awesome.