I'm doing some performance profiling on transfer speeds and was curious how the internal Stream.CopyTo() was written. The method I'm using currently closely matches the implementation for .NET Framework, but the .NET Core implementation is different:
This isn't the newest implementation, either, as the .NET source has moved and I'm pretty sure newer stuff is using pipes. I have an older branch here that experimented a bit with these.
Because this code dictates how transfers perform in terms of both speed and system resource usage, it should represent the "latest and greatest". Unfortunately, backward compatibility makes this a complex task. Additional preprocessor directives will need to be added to support NETSTANDARD2_0.
I'm doing some performance profiling on transfer speeds and was curious how the internal
Stream.CopyTo()
was written. The method I'm using currently closely matches the implementation for .NET Framework, but the .NET Core implementation is different:https://github.com/dotnet/corert/blob/master/src/System.Private.CoreLib/shared/System/IO/Stream.cs
This isn't the newest implementation, either, as the .NET source has moved and I'm pretty sure newer stuff is using pipes. I have an older branch here that experimented a bit with these.
Because this code dictates how transfers perform in terms of both speed and system resource usage, it should represent the "latest and greatest". Unfortunately, backward compatibility makes this a complex task. Additional preprocessor directives will need to be added to support
NETSTANDARD2_0
.