forked from microsoft/vstest
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Using BufferedStream over NetworkStream for performance improvement. (m…
…icrosoft#1041) * Using BufferedStream over NetworkStream for performance improvement. - Used BufferedStream over NetworkStream while writing the data to reduce the number of calls. - Used BufferedSize of 16KB. * Comments changed & Reverted some changes. * Addressed PR comments. * Adding test for the hang scenario. * Moving tests from performance folder to platform tests. * Resolved PR comments.
- Loading branch information
Showing
10 changed files
with
171 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
src/Microsoft.TestPlatform.CommunicationUtilities/SocketConstants.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
namespace Microsoft.VisualStudio.TestPlatform.CommunicationUtilities | ||
{ | ||
public class SocketConstants | ||
{ | ||
// Buffer size for the buffered stream we are using. | ||
public const int BufferSize = 16384; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/Microsoft.TestPlatform.PlatformAbstractions/Interfaces/IO/IStream.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
namespace Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.Interfaces | ||
{ | ||
using System.IO; | ||
|
||
/// <summary> | ||
/// Helper class to return plaform specific stream. | ||
/// </summary> | ||
public interface IStream | ||
{ | ||
/// <summary> | ||
/// Returns platrform specific Buffered Stream with desired buffer size. | ||
/// </summary> | ||
/// <param name="stream">Input Stream</param> | ||
/// <param name="bufferSize">Buffer Size</param> | ||
/// <returns>Buffered Stream</returns> | ||
Stream CreateBufferedStream(Stream stream, int bufferSize); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/Microsoft.TestPlatform.PlatformAbstractions/common/IO/PlatformStream.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
namespace Microsoft.VisualStudio.TestPlatform.PlatformAbstractions | ||
{ | ||
using System.IO; | ||
using Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.Interfaces; | ||
|
||
/// <inheritdoc/> | ||
public class PlatformStream : IStream | ||
{ | ||
/// <inheritdoc/> | ||
public Stream CreateBufferedStream(Stream stream, int bufferSize) | ||
{ | ||
return new BufferedStream(stream, bufferSize); | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/Microsoft.TestPlatform.PlatformAbstractions/netstandard1.0/IO/PlatformStream.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
namespace Microsoft.VisualStudio.TestPlatform.PlatformAbstractions | ||
{ | ||
using System; | ||
using System.IO; | ||
using Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.Interfaces; | ||
|
||
/// <inheritdoc/> | ||
public class PlatformStream : IStream | ||
{ | ||
/// <inheritdoc/> | ||
public Stream CreateBufferedStream(Stream stream, int bufferSize) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/IO/PlatformStream.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
namespace Microsoft.VisualStudio.TestPlatform.PlatformAbstractions | ||
{ | ||
using System.IO; | ||
using Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.Interfaces; | ||
|
||
/// <inheritdoc/> | ||
public class PlatformStream : IStream | ||
{ | ||
/// <inheritdoc/> | ||
public Stream CreateBufferedStream(Stream stream, int bufferSize) | ||
{ | ||
return stream; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters