When using async operations on FileStream, each operation ends up allocating several objects. By using a PreallocatedOverlapped, we can avoid the majority of those allocations, as well as avoid having to pin/unpin a buffer on each request.
This commit adds an optimization to FileStream that kicks in for the common case when:
- The buffer provided to ReadAsync/WriteAsync is smaller than the size of the FileStream's buffer, such that the FileStream's buffer is used. And when...
- Operations are not scheduled to run concurrently.
When those conditions are met, we use a PreallocatedOverlapped for the operation to avoid a ThreadPoolBoundHandleOverlapped, IOCompletionCallback, and _IOCompletionCallback getting allocated for each operation. This reduces the bytes allocated per operation by ~50% and the number of objects allocated by ~60%. It also saves having to pin/unpin the buffer on each operation.
When those conditions aren't met, we simply use the same code that's used today.
Commit migrated from https://github.com/dotnet/corefx/commit/c01617841be8b5087ed37f64bb2395afc722e549
Windows.winmd was removed from M.TP.Private.NetNative targeting pack
so when some projects were bumped to a that version which needed
that reference they were broken. To fix we needed to explicitly add
a package dependency to M.TP.Private.WinRT package.
Commit migrated from https://github.com/dotnet/corefx/commit/674638364d94441854edf05c75e0e59a9c9a76ac
Previously on unix we would use stat to get information about directories and files for DirectoryInfo and FileInfo. That meant that we wouldn't correctly report ReparsePoint for symlinks, and the code was changed to use LStat. But that then breaks important use cases, such as by DirectoryInfo.Exist for a symlink to a directory always returning false.
This commit provides a compromise: we first use lstat, and if we find it's a symlink, we use stat but remember separately that it's a symlink so we can include ReparsePoint in the reported attributes.
Commit migrated from https://github.com/dotnet/corefx/commit/36259dc3c72fb1dc2a71a06db6f7dce9ea88c642
FilterToOSGroup was flowing from .builds to csproj
which was causing unique global property sets for
the same csproj. As a result the projects would
build multiple times and race when writing output.
[tfs-changeset: 1562265]
Commit migrated from https://github.com/dotnet/corefx/commit/a5d558bcf7713e56c237de704f3d70c4927d8f44
This these .builds files were updated and generated from a script
based on the configurations defined in the matching csproj files.
This updates the builds files to specify OSGroup and TargetGroup
as metadata instead of using AdditionalProperties and also sorts them by
TargetGroup followed by OSGroup.
Commit migrated from https://github.com/dotnet/corefx/commit/95efe37475916016a5fc6ee6f0ba584d990c4196
This add a default configuration before the Import of dirs.props
for any projects that don't have Debug as the default configuration.
Removed Configuration and Platform properties set after dirs.props
as they would have no affect and just cause confusion.
Removed OutputType=Library property as it isn't necessary.
Commit migrated from https://github.com/dotnet/corefx/commit/9e1da13cf6d5ff4b37b1867beb3411a2fe61da6a
After this change if you build a .builds file it will all projects
defined in it. However if you specify OSGroup or FilterOSGroup as a property
it will only build the projects that are for that OSGroup or AnyOS.
Change the default OSGroup to AnyOS instead of Windows_NT.
By default if you build from the root it will only filter the projects to
just the OS that you are building on (including anything that is AnyOS).
If you want to build all projects for all OS's from the root pass
/p:BuildAllOSGroups=true property from the command line.
Includes an update to project-guidelines.md and windows-instructions.md docs
with information on the changes.
[MERGE with support commit]
Commit migrated from https://github.com/dotnet/corefx/commit/7146f1be15bbe9b82949cb71b3f1d3548a10fd5e
This change switches the TFS package buid to use the packaging
infrastructure from the buildtools package. For any package
project that exists in corefx/wcf we will use that in place of the
closed source package.
As we move more package projects to the open they will
automatically be preferred over the closed source projects.
[tfs-changeset: 1559910]
Commit migrated from https://github.com/dotnet/corefx/commit/1b77984dd736f848e39808df7802aae77b02f975
Currently, the tests System.IO.Tests.FileStream_SafeFileHandle.
ThrowWhenHandlePositionIsChanged and System.Net.NetworkInformation.
Tests.UnixPingUtilityTests.PacketSizeIsRespected hang when running on a
Unix machine with 1 thread. Declaring the tests async fixes this issue.
Commit migrated from https://github.com/dotnet/corefx/commit/6d15aa69e332866e6282994edfd2de5ca0192899
These facade project files were generated using a porting tool I wrote,
which examined some information from our internal build and created
appropriate project files. I have also re-generated all of the .builds
files so that they import the facade projects in the correct manner.
Commit migrated from https://github.com/dotnet/corefx/commit/58e2f6e862060039e1ebad727d75c87703fdb2f2