Skip to content

Commit

Permalink
Reduce unzip buffer to 4 MB/thread + Use Uninit Array
Browse files Browse the repository at this point in the history
  • Loading branch information
neon-nyan committed Sep 29, 2024
1 parent 434b230 commit 6a1df2d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1670,8 +1670,8 @@ await Parallel.ForEachAsync(
private async Task ExtractUsingNativeZipWorker(IEnumerable<int> entriesIndex, List<ZipArchiveEntry> entries,
CancellationToken cancellationToken)
{
// 16 MB of buffer (hope it's not too big)
byte[] buffer = new byte[16 << 20];
// 4 MB of buffer
byte[] buffer = GC.AllocateUninitializedArray<byte>(4 << 20);

foreach (int entryIndex in entriesIndex)
{
Expand Down

0 comments on commit 6a1df2d

Please sign in to comment.