This repository has been archived by the owner on Jul 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Larger buffer for file and network operations. (#704)
* larger buffer for stream copy * Argument checks. * configuration for package downloader. * Using the default value for buffer size. * Removed explicit package downloader configuration * Comment on buffer size for file streams.
- Loading branch information
Showing
4 changed files
with
51 additions
and
2 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
19 changes: 19 additions & 0 deletions
19
src/Validation.Common.Job/PackageDownloaderConfiguration.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) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
namespace NuGet.Jobs.Validation | ||
{ | ||
public class PackageDownloaderConfiguration | ||
{ | ||
/// <summary> | ||
/// The size of the buffer used to copy the network stream. | ||
/// </summary> | ||
/// <remarks>Implementation uses the <see cref="System.IO.Stream.CopyToAsync(System.IO.Stream, int, System.Threading.CancellationToken)"/> | ||
/// passing that value as the second argument. | ||
/// | ||
/// Setting the package downloader default buffer size to the buffer size used for copying streams | ||
/// see https://github.com/dotnet/corefx/blob/master/src/Common/src/CoreLib/System/IO/Stream.cs#L32-L35 | ||
/// </remarks> | ||
public int BufferSize { get; set; } = 80 * 1024; | ||
} | ||
} |
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