Commit Graph
1561 Commits
Author SHA1 Message Date
Stephen Toub 816ce5533c Optimize overlapped I/O FileStream.CopyToAsync implementation on Windows
Add an override of CopyToAsync in the Windows implementation of FileStream for use when the stream is constructed in async mode.

The base stream implementation does a simple loop that reads from the source and writes to the destination.  For the Windows implementation of FileStream in async mode, each of these read operations involves overhead, such as allocating the task to return from the operation, registering with the providing cancellation token, etc.  For CopyToAsync, we’re responsible for all of the reads, which means we can avoid these per-read costs.

Copying a 10MB file to a MemoryStream with the default buffer size and with a cancelable token improved throughput by 50%, and (not including the copy buffer) reduced the number of allocations from 860 to 11 and the bytes allocated from 52K to ~730b. Copying a 100 byte file to a MemoryStream with the default buffer size and with a non-cancelable token improved throughput by 30% and (not including the copy buffer) reduced the number of allocations from 46 to 11 and the bytes allocated from 1.1K to ~670b.

(I briefly explored adding an override for when in sync mode, but the savings there aren’t nearly as significant or measurable.  At best it can avoid a Task per read.  We can look more seriously at doing that separately, if desired; that could likely also be done for the Unix implementation.)


Commit migrated from https://github.com/dotnet/corefx/commit/daf9745a6871a6cf1e79c046d49033917757244f
2016-09-12 20:25:11 -04:00
Jose Perez Rodriguez 1105adec7a Merge remote-tracking branch 'mainrepo/dev/api' into MergeDevApi
Commit migrated from https://github.com/dotnet/corefx/commit/a1989d82cff273db667638e4836ea7836f5c6eb9
2016-09-12 15:20:12 -07:00
Lakshmi Priya Sekar 3124b74699 Update xunit.netcore.extensions version.
Commit migrated from https://github.com/dotnet/corefx/commit/a5d8ccf7c7080094bc6b7769cb5831c80bc5fd76
2016-09-12 11:35:32 -07:00
dotnet-bot acdc501149 Update CoreClr, CoreFx to beta-24512-03, beta-24512-01, respectively
Commit migrated from https://github.com/dotnet/corefx/commit/3df0516607085d17065a6116c7abc80c4e3af290
2016-09-12 16:17:05 +00:00
dotnet-bot dedd766eff Update CoreClr, CoreFx, ProjectNTfs to beta-24512-02, beta-devapi-24512-01, beta-24512-00, respectively
Commit migrated from https://github.com/dotnet/corefx/commit/141f99a8e273e4288ca3d827aa10d00e64cb5bcc
2016-09-12 08:23:26 +00:00
Ben Adams 3ac40528d0 Replace Contract.Requires with Debug.Assert (dotnet/corefx#11600)
* Replace Contract.Requires with Debug.Assert
* Remove unnessary Diagnostics.Contracts usings

Commit migrated from https://github.com/dotnet/corefx/commit/3c0e84832d9cd0a97c11dd8658722f69b6b1bc8e
2016-09-11 19:06:57 -04:00
dotnet-bot 18b78b4c1f Update CoreClr, CoreFx to beta-24511-02, beta-devapi-24511-01, respectively
Commit migrated from https://github.com/dotnet/corefx/commit/ae7f1882d122ae773eaf5e0d507fe2df2139a0bf
2016-09-11 08:12:24 +00:00
Stephen Toub aa244aa6f8 Merge pull request dotnet/corefx#11560 from dotnet-bot/master-UpdateDependencies
Update CoreClr, CoreFx, External to beta-24510-02, beta-24510-01, beta-24509-00, respectively (master)

Commit migrated from https://github.com/dotnet/corefx/commit/416a52195110d0e23c7c44bc7e91e97fe66dd90f
2016-09-10 16:47:41 -04:00
Stephen Toub a01f853a99 Merge pull request dotnet/corefx#11582 from stephentoub/copytoasync_tests
Add tests for FileStream.CopyToAsync

Commit migrated from https://github.com/dotnet/corefx/commit/9a3425d770b93702e2b59bdadec3116f84fcedb5
2016-09-10 16:47:25 -04:00
dotnet-bot aae1eef0fe Update CoreClr, CoreFx, External to beta-24510-02, beta-24510-01, beta-24509-00, respectively
Commit migrated from https://github.com/dotnet/corefx/commit/c1870256431a6ca13c321af37bc68868d046cf81
2016-09-10 15:25:05 -04:00
Stephen Toub 5ecce8905d Disable failing WindowsSearchPatternInvalid test
Commit migrated from https://github.com/dotnet/corefx/commit/f0b9bf22513d2b38f8d62505b8ea46c3c2042eac
2016-09-10 14:34:26 -04:00
Stephen Toub a2f1dade91 Add tests for FileStream.CopyToAsync
Commit migrated from https://github.com/dotnet/corefx/commit/eb3622c6e2947382e3c546cac0fc98213c13d4ca
2016-09-10 13:42:33 -04:00
dotnet-bot d6ed58d1f6 Update CoreClr, CoreFx, External to beta-24510-02, beta-devapi-24510-01, beta-24509-00, respectively
Commit migrated from https://github.com/dotnet/corefx/commit/2177e4aa7dd0d6099e849398cc75ddab5401d3f9
2016-09-10 08:20:00 +00:00
Eric Eilebrecht be96f805d0 Work around known issues in "Ubuntu on Windows" (dotnet/corefx#11574)
The latest Windows 10 preview builds contain enough functionality in Ubuntu/Bash on Windows (a.k.a. Windows Subsystem for Linux, or WSL) that .NET Core mostly works now. With the fix for dotnet/corefx#11058, we can even build/test the CoreFx tree in this environment. Currently there are a few test failures; I've been working on identifying the causes of these, and filing bugs in the appropriate repos. 
This change implements workarounds for all of the current known issues in the "inner loop" tests. Mostly, I've just conditionally disabled tests when running in the WSL environment. 
There is still an issue, under investigation, causing non-deterministic failures in the System.Net.Http tests (Microsoft/BashOnWindowsdotnet/corefx#1068). And I haven't tried OuterLoop runs of anything but the networking tests. 

Commit migrated from https://github.com/dotnet/corefx/commit/d9aa92f6616d851256339318aadb89a6737e6d13
2016-09-09 20:10:01 -07:00
Jose Perez Rodriguez 402de0ceda Removing pkgproj references from csprojs
Commit migrated from https://github.com/dotnet/corefx/commit/286c1be983e6dd7ef2e458494ba360d7c1423747
2016-09-09 10:07:59 -07:00
Jeremy Kuhne 4877f59c89 Merge pull request dotnet/corefx#8669 from JeremyKuhne/pathcleanup
Windows path tweaks

Commit migrated from https://github.com/dotnet/corefx/commit/12e18e2937e6876cd379be0237ee06f12afffb5b
2016-09-09 09:59:13 -07:00
dotnet-bot 1362c77e30 Update CoreClr, CoreFx to beta-24509-03, beta-24509-01, respectively
Commit migrated from https://github.com/dotnet/corefx/commit/791c42cc72174ff454f58e7d9678ce25f300e543
2016-09-09 08:19:56 +00:00
dotnet-bot b4d3b58080 Update CoreClr, CoreFx, ProjectNTfs to beta-24509-03, beta-devapi-24509-01, beta-24509-00, respectively
Commit migrated from https://github.com/dotnet/corefx/commit/b0752ce47fb6a5935827c89cfa0928b3934d2f37
2016-09-09 08:12:40 +00:00
Jose Perez Rodriguez df7fec857c Project json updates to get branch building + removing some tests that were failing for netcoreapp1.1
Commit migrated from https://github.com/dotnet/corefx/commit/cfcfbf9c37dd3f2bf864b5fbbacd0ce6e2e9c1ec
2016-09-08 19:16:08 -07:00
Jose Perez Rodriguez 88a0ac9027 Fix package versions
Commit migrated from https://github.com/dotnet/corefx/commit/d52a955d64b1a14887b22a2c1ce27082bf31128f
2016-09-08 08:23:53 -07:00
dotnet-bot 8d8fb53a8f Update CoreClr, CoreFx, External, ProjectNTfs to beta-24508-02, beta-devapi-24508-03, beta-24507-00, beta-24508-00, respectively
Commit migrated from https://github.com/dotnet/corefx/commit/ba1dbe35b8c7b6ff7a9d8a607ae465a48c889d97
2016-09-08 08:22:27 +00:00
Jeremy Kuhne fda65c5792 Windows path tweaks
- Simplify the path length check to match desktop
- Tweak IsPartiallyQualified to match desktop
- Update wildcards to actually match what Windows supports


Commit migrated from https://github.com/dotnet/corefx/commit/50cb4c1b00cd3e048c197a161006aa811c82a1bf
2016-09-07 11:12:34 -07:00
Eric Mellino 53e9a2b08d Update TestSuite package to 1.0.0-prerelease-00807-03
Commit migrated from https://github.com/dotnet/corefx/commit/9447d75da2117e577e6a8549cb679e77207d5a26
2016-09-07 10:58:44 -07:00
Ian Hays bc45535170 Merge pull request dotnet/corefx#11349 from ianhays/IO_symlink_tests
Use rooted path for symlink creation in IO tests

Commit migrated from https://github.com/dotnet/corefx/commit/9fbfe43dbd61f06e6c9c7a481b5edf4d19f8db1d
2016-09-07 08:33:19 -07:00
dotnet-bot 359d69c099 Update CoreFx, External to beta-24507-02, beta-24507-00, respectively
Commit migrated from https://github.com/dotnet/corefx/commit/e3592f39bda1cf050ef177a1b1d50814e895a295
2016-09-07 05:23:10 +00:00
Stephen Toub 56dac79c7d Merge pull request dotnet/corefx#11485 from stephentoub/remove_more_deadcode
Remove some more dead code across a few libs

Commit migrated from https://github.com/dotnet/corefx/commit/72e47e2d7fda356a0b417587ac018d0df9ce12ac
2016-09-06 22:51:24 -04:00
Stephen Toub 5bf82179f3 Remove some more dead code across a few libs
Commit migrated from https://github.com/dotnet/corefx/commit/827e85b010702abe05ee86b6fbea7414b9eba342
2016-09-06 21:40:25 -04:00
dotnet-bot b7b9f635b6 Update CoreClr, CoreFx to beta-24507-02, beta-24507-01, respectively
Commit migrated from https://github.com/dotnet/corefx/commit/bac52af892d58a3d9d1e56bf4568315ea00af69f
2016-09-07 00:57:20 +00:00
Stephen Toub ecb2adf496 Merge pull request dotnet/corefx#11375 from stephentoub/fix_async_test
Fix FileStreamBase Begin/End race condition

Commit migrated from https://github.com/dotnet/corefx/commit/1ee4b359ea2fc13e451e08a8aa6d5ac561c1e989
2016-09-06 20:02:15 -04:00
dotnet-bot e2201cce59 Update CoreFx to beta-24506-02
Commit migrated from https://github.com/dotnet/corefx/commit/5b019148ca9f6dddbde058c88a1638e9a1038928
2016-09-06 14:33:47 +00:00
dotnet-bot ab1530f48e Update CoreClr, CoreFx, External to beta-24506-02, beta-24506-01, beta-24506-00, respectively
Commit migrated from https://github.com/dotnet/corefx/commit/0aec2bab9dd980829d66d6f67a119fea832301d3
2016-09-06 09:10:59 +00:00
dotnet-bot 825730b21f Update CoreClr, CoreFx, External to beta-24505-02, beta-24505-01, beta-24505-00, respectively
Commit migrated from https://github.com/dotnet/corefx/commit/183bd2f332546046de269246eec6f7f71f4d50cb
2016-09-05 14:24:29 +00:00
Jose Perez Rodriguez 72a0d666a2 Adding Reflection changes back after merge from master (dotnet/corefx#11386)
Adding Reflection changes back after merge from master


Commit migrated from https://github.com/dotnet/corefx/commit/65e117580923503b1e970c95798f19baff568b5e
2016-09-03 14:00:39 -07:00
dotnet-bot cec9baaf99 Update CoreClr, CoreFx to beta-24503-02, beta-devapi-24503-01, respectively
Commit migrated from https://github.com/dotnet/corefx/commit/062c5a22cef03332558c4726078615061a88d7b6
2016-09-03 09:30:27 +00:00
dotnet-bot 74834b865c Update CoreClr, CoreFx, External to beta-24503-01, beta-24502-03, beta-24502-00, respectively
Commit migrated from https://github.com/dotnet/corefx/commit/b507f173e654e1ab61871f5a0c39d5bbdc08a29b
2016-09-03 01:22:25 +00:00
dotnet-bot a37985e165 Update CoreClr, CoreFx, External, ProjectNTfs to beta-24502-03, beta-devapi-24502-02, beta-24502-00, beta-24502-00, respectively
Commit migrated from https://github.com/dotnet/corefx/commit/3c724e11c6d1c94ed8d22b510e23333471a9a50c
2016-09-02 19:42:48 +00:00
Stephen Toub 03d9aaf411 Fix FileStreamBase Begin/End race condition
The new FileStreamBase.Begin/End overloads do argument and state validation similar to that of desktop.  There is a subtle but critical difference, however: in this validation, desktop checks to see whether the stream is closed via ```_handle.IsClosed```, whereas FileStreamBase does it via ```SafeFileHandle.IsClosed```.  ```SafeFileHandle``` is an abstract property that returns the handle... but it also flushes.  The base Stream's Begin/End implementation has synchronization to ensure that only one async operation is in flight at a time, but this call to ```SafeFileHandle.IsClosed``` comes before that synchronization kicks in (it's in the base), and as such we end up potentially having a Flush invocations concurrently with Write invocations (Write is called asynchronously from the base BeginWrite), which is very unsafe.

This commit fixes it by adding an IsClosed property that goes directly to the underlying handle, bypassing the publicly exposed SafeFileHandle (that flushes so that direct access to the file via the handle is consistent with operations already performed on the FileStream).

(I also fixed a small issue in the ManyConcurrentWriteAsyncs that highlighted the issue.  Order of async read/write operations is only guaranteed on FileStream when in async mode; in non-async mode, it's theoretically possible (though unlikely) for operations to complete out-of-order, but the test is validating that the operations completed in order.  While I've never seen this fail, I'm proactively fixing it.)


Commit migrated from https://github.com/dotnet/corefx/commit/5afb9f69400cbb61971a7eeb4fcfc49fbbc1080b
2016-09-02 11:48:36 -04:00
Jose Perez Rodriguez 1e6d178df5 Changes required to have dev/api building again after merge
Commit migrated from https://github.com/dotnet/corefx/commit/bf7911a1ba3cfdf389527276d7991312dbd2b8c9
2016-09-01 16:47:55 -07:00
Jose Perez Rodriguez 6cb037809c Revert "Expose all Reflection APIs in System.Runtime"
Commit migrated from https://github.com/dotnet/corefx/commit/1b9fa4bc4e4ed2da511374543c6460ba6b4f8c6b
2016-09-01 14:19:37 -07:00
Sepideh Khoshnood 2c5119c7e2 Expose all Reflection APIs in System.Runtime (dotnet/corefx#11099)
Expose all System.Reflection APIs

Commit migrated from https://github.com/dotnet/corefx/commit/b647c01bba129ad9194b6dee2de888c00c59f962
2016-09-01 11:31:12 -07:00
Jose Perez Rodriguez 6328e7431b Merge remote-tracking branch 'upstream/master' into dev/api
Commit migrated from https://github.com/dotnet/corefx/commit/ea0cc674b8116a10c18c2879390c39ec08df8020
2016-09-01 11:30:16 -07:00
Ian Hays 969ebf860d Use rooted path for symlink creation in IO tests
Commit migrated from https://github.com/dotnet/corefx/commit/68836fa5f2c1b5dd525fa58321fbdf210e72bc6c
2016-09-01 11:10:21 -07:00
dotnet-bot dba1111349 Update CoreFx to beta-24501-02
Commit migrated from https://github.com/dotnet/corefx/commit/3a8894d373c2ef2814265363d70ff0c09bbf36be
2016-09-01 14:38:48 +00:00
dotnet-bot 75194b0891 Update CoreClr, CoreFx, External to beta-24431-03, beta-24501-01, beta-24501-00, respectively
Commit migrated from https://github.com/dotnet/corefx/commit/b2704a1b772c5478cecbb7e9e6d2c02866e0b943
2016-09-01 05:24:53 +00:00
dotnet-bot deb0efc960 Update External, ProjectNTfs to beta-24501-00, beta-24501-00, respectively
Commit migrated from https://github.com/dotnet/corefx/commit/876715e44d8b37fcc4f0215977ccf2c83bc91b9f
2016-09-01 05:17:19 +00:00
Jose Perez Rodriguez 8a6892f2fb Enable netcoreapp1.1 tests to run as part of the CI build (dotnet/corefx#11236)
Enable netcoreapp1.1 tests to run as part of the CI build

Commit migrated from https://github.com/dotnet/corefx/commit/4644f59c447b56106594883a3f9a022bfbe870a4
2016-08-31 19:28:16 -07:00
Lakshmi Priya Sekar bf56168dfc Update xunit.netcore.extensions version.
Commit migrated from https://github.com/dotnet/corefx/commit/193dbf7f96120b2bb2ce95cf48576abae5db33bd
2016-08-31 12:55:52 -07:00
Davis Goodin 8902a6c513 Update ProjectNTfs to beta-24430-00
Commit migrated from https://github.com/dotnet/corefx/commit/19252996e2f45356f6614a2a513b9d2fa7191e7f
2016-08-31 10:27:53 -05:00
dotnet-bot 6606d42d64 Update CoreClr, CoreFx, External to beta-24431-02, beta-24431-01, beta-24431-00, respectively
Commit migrated from https://github.com/dotnet/corefx/commit/d0fb971379e06a252337b387816337a8fa982903
2016-08-31 09:11:00 +00:00
Eric St. John e6e5ed7c59 Remove PackageTargetFramework usage
Commit migrated from https://github.com/dotnet/corefx/commit/c3042ed04fa3a246c544a7ead7d564b1d43e9862
2016-08-30 15:30:50 -07:00