Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Reuse the throw away buffer in ZipHelper#69439

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
eerhardt merged 2 commits intodotnet:mainfromeerhardt:ReuseThrowAwayBufferInZip
May 17, 2022

Conversation

eerhardt
Copy link
Member

ZipHelper.AdvanceToPosition was allocating a new temporary buffer every time through the loop while reading from the stream. Changing the code to reuse the same buffer through the loop.

Benchmark

Code

usingBenchmarkDotNet.Attributes;usingSystem.IO.Compression;namespaceBenchmark;[MemoryDiagnoser]publicclassZipArchiveBenchmark{[Benchmark]publicZipArchiveEntryReadZipContainingExtraFields(){ZipArchivearchive=new(newMemoryStream(s_Zip64Data));returnarchive.GetEntry("file.txt");}privatestaticreadonlybyte[]s_Zip64Data={// ===== Local file header signature 0x04034b500x50,0x4b,0x03,0x04,// version to extract 4.50x2d,0x00,// general purpose flags0x00,0x08,// 0000_1000 'for enhanced deflating'// Deflate0x08,0x00,// Last mod file time0x17,0x9b,// Last mod date0x6d,0x52,// CRC320x0c,0x7e,0x7f,0xd8,// compressed size0xff,0xff,0xff,0xff,// UNcompressed size0xff,0xff,0xff,0xff,// file name length0x08,0x00,// extra field length0x38,0x00,// filename0x66,0x69,0x6c,0x65,0x2e,0x74,0x78,0x74,// -----Zip64 extra field tag0x01,0x00,// size of extra field block0x10,0x00,// 8 byte Zip64 UNcompressed size, index 420x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,// 8 byte Zip64 compressed size, index 500x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,// ----- NTFS extra field tag0x0a,0x00,// size of extra field block0x20,0x00,// reserved0x00,0x00,0x00,0x00,// tag #10x01,0x00,// size of tag #10x18,0x00,// Mtime, CTime, Atime0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,// -------------// Data!0x2b,0x49,0x2d,0x2e,0x01,0x00,// -------- Central directory signature 0x02014b500x50,0x4b,0x01,0x02,// version made by 4.50x2d,0x00,// version to extract 4.50x2d,0x00,// general purpose flags0x00,0x08,// Deflate0x08,0x00,// Last mod file time0x17,0x9b,// Last mod date0x6d,0x52,// CRC320x0c,0x7e,0x7f,0xd8,// 4 byte compressed size, index 120 (-1 indicates refer to Zip64 extra field)0xff,0xff,0xff,0xff,// 4 byte UNcompressed size, index 124 (-1 indicates refer to Zip64 extra field)0xff,0xff,0xff,0xff,// file name length0x08,0x00,// extra field length0x08,0x04,// file comment length0x00,0x00,// disk number start (-1 indicates refer to Zip64 extra field)0x00,0x00,// internal file attributes0x00,0x00,// external file attributes0x00,0x00,0x00,0x00,// relative offset of local header (-1 indicates refer to Zip64 extra field)0x00,0x00,0x00,0x00,// file name0x66,0x69,0x6c,0x65,0x2e,0x74,0x78,0x74,// extra field, content similar to before0x01,0x00,0x1c,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0a,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x18,0x00,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,// A MADE-UP EXTRA FIELD THAT NEEDS TO BE SKIPPED0x07,0x00,0xC0,0x03,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,// == 'end of zip64 central directory record' signature 0x06064b500x50,0x4b,0x06,0x06,// size0x2c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,// version made by, version needed0x2d,0x00,0x2d,0x00,// disk number, disk number with CD0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,// total number of CD records0x01,0x00,0x00,0x00,// size of CD0x00,0x00,0x00,0x00,// offset of start of CD wrt starting disk0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,// zip64 extensible data sector0x7a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x00,0x00,0x00,0x00,// == 'zip64 end of CD locator' signature 0x07064b500x50,0x4b,0x06,0x07,// number of disk with zip64 CD0x00,0x00,0x00,0x00,// relative offset of zip64 ECD0xa2,0x04,0x00,0x00,0x00,0x00,0x00,0x00,// total number of disks0x01,0x00,0x00,0x00,// == 'end of CD' signature 0x06054b500x50,0x4b,0x05,0x06,// disk number, disk number with CD (-1 indicates refer to Zip64 extra field)0x00,0x00,0x00,0x00,// total number of entries in CD on this disk, and overall  (-1 indicates refer to Zip64 extra fields)0xff,0xff,0xff,0xff,// size of CD (-1 indicates refer to Zip64 extra field)0x7a,0x00,0x00,0x00,// offset of start of CD wrt start disk (-1 indicates refer to Zip64 extra field)0x64,0x00,0x00,0x00,// comment length0x00,0x00};}

Results

BenchmarkDotNet=v0.13.1, OS=Windows 10.0.19043.1706 (21H1/May2021Update)Intel Core i7-8700 CPU 3.20GHz (Coffee Lake), 1 CPU, 12 logical and 6 physical cores.NET SDK=6.0.300  [Host]     : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT  Job-KPZXDU : .NET 7.0.0 (42.42.42.42424), X64 RyuJIT  Job-FWBHEB : .NET 7.0.0 (42.42.42.42424), X64 RyuJIT
MethodJobToolchainMeanErrorStdDevRatioGen 0Gen 1Allocated
ReadZipContainingExtraFieldsJob-KPZXDU\main\corerun.exe1,082.0 ns16.70 ns15.62 ns1.000.46920.00383 KB
ReadZipContainingExtraFieldsJob-FWBHEB\pr\corerun.exe968.6 ns3.66 ns3.06 ns0.900.25750.00192 KB

ZipHelper.AdvanceToPosition was allocating a new temporary buffer every time through the loop while reading from the stream. Changing the code to reuse the same buffer through the loop.
@ghost
Copy link

Tagging subscribers to this area: @dotnet/area-system-io-compression
See info inarea-owners.md if you want to be subscribed.

Issue Details

ZipHelper.AdvanceToPosition was allocating a new temporary buffer every time through the loop while reading from the stream. Changing the code to reuse the same buffer through the loop.

Benchmark

Code

usingBenchmarkDotNet.Attributes;usingSystem.IO.Compression;namespaceBenchmark;[MemoryDiagnoser]publicclassZipArchiveBenchmark{[Benchmark]publicZipArchiveEntryReadZipContainingExtraFields(){ZipArchivearchive=new(newMemoryStream(s_Zip64Data));returnarchive.GetEntry("file.txt");}privatestaticreadonlybyte[]s_Zip64Data={// ===== Local file header signature 0x04034b500x50,0x4b,0x03,0x04,// version to extract 4.50x2d,0x00,// general purpose flags0x00,0x08,// 0000_1000 'for enhanced deflating'// Deflate0x08,0x00,// Last mod file time0x17,0x9b,// Last mod date0x6d,0x52,// CRC320x0c,0x7e,0x7f,0xd8,// compressed size0xff,0xff,0xff,0xff,// UNcompressed size0xff,0xff,0xff,0xff,// file name length0x08,0x00,// extra field length0x38,0x00,// filename0x66,0x69,0x6c,0x65,0x2e,0x74,0x78,0x74,// -----Zip64 extra field tag0x01,0x00,// size of extra field block0x10,0x00,// 8 byte Zip64 UNcompressed size, index 420x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,// 8 byte Zip64 compressed size, index 500x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,// ----- NTFS extra field tag0x0a,0x00,// size of extra field block0x20,0x00,// reserved0x00,0x00,0x00,0x00,// tag #10x01,0x00,// size of tag #10x18,0x00,// Mtime, CTime, Atime0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,// -------------// Data!0x2b,0x49,0x2d,0x2e,0x01,0x00,// -------- Central directory signature 0x02014b500x50,0x4b,0x01,0x02,// version made by 4.50x2d,0x00,// version to extract 4.50x2d,0x00,// general purpose flags0x00,0x08,// Deflate0x08,0x00,// Last mod file time0x17,0x9b,// Last mod date0x6d,0x52,// CRC320x0c,0x7e,0x7f,0xd8,// 4 byte compressed size, index 120 (-1 indicates refer to Zip64 extra field)0xff,0xff,0xff,0xff,// 4 byte UNcompressed size, index 124 (-1 indicates refer to Zip64 extra field)0xff,0xff,0xff,0xff,// file name length0x08,0x00,// extra field length0x08,0x04,// file comment length0x00,0x00,// disk number start (-1 indicates refer to Zip64 extra field)0x00,0x00,// internal file attributes0x00,0x00,// external file attributes0x00,0x00,0x00,0x00,// relative offset of local header (-1 indicates refer to Zip64 extra field)0x00,0x00,0x00,0x00,// file name0x66,0x69,0x6c,0x65,0x2e,0x74,0x78,0x74,// extra field, content similar to before0x01,0x00,0x1c,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0a,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x18,0x00,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,// A MADE-UP EXTRA FIELD THAT NEEDS TO BE SKIPPED0x07,0x00,0xC0,0x03,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0x00,0x00,0x00,0x00,0x25,0x18,0xd7,0x01,0x01,0x00,0x18,0x00,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,0xa8,0xb1,0xf6,0x61,0x25,0x18,0xd7,0x01,// == 'end of zip64 central directory record' signature 0x06064b500x50,0x4b,0x06,0x06,// size0x2c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,// version made by, version needed0x2d,0x00,0x2d,0x00,// disk number, disk number with CD0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,// total number of CD records0x01,0x00,0x00,0x00,// size of CD0x00,0x00,0x00,0x00,// offset of start of CD wrt starting disk0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,// zip64 extensible data sector0x7a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x00,0x00,0x00,0x00,// == 'zip64 end of CD locator' signature 0x07064b500x50,0x4b,0x06,0x07,// number of disk with zip64 CD0x00,0x00,0x00,0x00,// relative offset of zip64 ECD0xa2,0x04,0x00,0x00,0x00,0x00,0x00,0x00,// total number of disks0x01,0x00,0x00,0x00,// == 'end of CD' signature 0x06054b500x50,0x4b,0x05,0x06,// disk number, disk number with CD (-1 indicates refer to Zip64 extra field)0x00,0x00,0x00,0x00,// total number of entries in CD on this disk, and overall  (-1 indicates refer to Zip64 extra fields)0xff,0xff,0xff,0xff,// size of CD (-1 indicates refer to Zip64 extra field)0x7a,0x00,0x00,0x00,// offset of start of CD wrt start disk (-1 indicates refer to Zip64 extra field)0x64,0x00,0x00,0x00,// comment length0x00,0x00};}

Results

BenchmarkDotNet=v0.13.1, OS=Windows 10.0.19043.1706 (21H1/May2021Update)Intel Core i7-8700 CPU 3.20GHz (Coffee Lake), 1 CPU, 12 logical and 6 physical cores.NET SDK=6.0.300  [Host]     : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT  Job-KPZXDU : .NET 7.0.0 (42.42.42.42424), X64 RyuJIT  Job-FWBHEB : .NET 7.0.0 (42.42.42.42424), X64 RyuJIT
MethodJobToolchainMeanErrorStdDevRatioGen 0Gen 1Allocated
ReadZipContainingExtraFieldsJob-KPZXDU\main\corerun.exe1,082.0 ns16.70 ns15.62 ns1.000.46920.00383 KB
ReadZipContainingExtraFieldsJob-FWBHEB\pr\corerun.exe968.6 ns3.66 ns3.06 ns0.900.25750.00192 KB
Author:eerhardt
Assignees:-
Labels:

area-System.IO.Compression

Milestone:-

@eerhardteerhardt merged commit31f6d1f intodotnet:mainMay 17, 2022
@eerhardteerhardt deleted the ReuseThrowAwayBufferInZip branchMay 17, 2022 22:01
@ghostghost locked asresolvedand limited conversation to collaboratorsJun 17, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@stephentoubstephentoubstephentoub approved these changes

Assignees

@eerhardteerhardt

Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@eerhardt@stephentoub

[8]ページ先頭

©2009-2025 Movatter.jp