update benchmarks to include async paths#1202
Conversation
Code Review SummaryStatus: 4 New Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
SUGGESTION
Other Observations (not in diff)No issues found in unchanged code. Files Reviewed (8 files)
|
tests/SharpCompress.Performance/Benchmarks/SevenZipBenchmarks.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
This pull request adds comprehensive async benchmarks for all major SharpCompress archive operations, providing performance measurements for both sync and async code paths. It also updates documentation to guide users on async API usage patterns and common pitfalls.
Changes:
- Added async benchmark variants for all archive format operations (GZip, Rar, 7Zip, Tar, Zip) covering Archive API, Reader API, and Writer API
- Updated AGENTS.md to document async factory methods and best practices for async usage
- Enhanced benchmark configuration with increased warmup and iteration counts for more robust measurements
- Updated baseline results with performance data from new async benchmarks
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/SharpCompress.Performance/Benchmarks/GZipBenchmarks.cs | Added async compress and decompress benchmarks |
| tests/SharpCompress.Performance/Benchmarks/RarBenchmarks.cs | Added async Archive and Reader API extraction benchmarks |
| tests/SharpCompress.Performance/Benchmarks/SevenZipBenchmarks.cs | Added async LZMA, LZMA2, and LZMA2 Reader extraction benchmarks |
| tests/SharpCompress.Performance/Benchmarks/TarBenchmarks.cs | Added async Archive API, Reader API, TarGzip, and create benchmarks |
| tests/SharpCompress.Performance/Benchmarks/ZipBenchmarks.cs | Added async Archive API, Reader API, and create benchmarks |
| tests/SharpCompress.Performance/Program.cs | Increased warmup (3→5), iteration (10→30), invocation (10→30) counts and unroll factor (1→2) |
| tests/SharpCompress.Performance/README.md | Updated format descriptions to indicate sync and async variants |
| tests/SharpCompress.Performance/baseline-results.md | Updated with new benchmark results including async variants |
| AGENTS.md | Documented async factory methods and added guidance on async usage patterns |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tests/SharpCompress.Performance/Benchmarks/SevenZipBenchmarks.cs
Outdated
Show resolved
Hide resolved
tests/SharpCompress.Performance/Benchmarks/SevenZipBenchmarks.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
| { | ||
| using var stream = new MemoryStream(_lzmaBytes); | ||
| await using var archive = SevenZipArchive.OpenAsyncArchive(stream); | ||
| foreach (var entry in archive.Entries.Where(e => !e.IsDirectory)) |
There was a problem hiding this comment.
WARNING: Inconsistent async archive usage. This benchmark uses OpenAsyncArchive (async) with archive.Entries (sync) instead of archive.EntriesAsync. Per AGENTS.md guidelines, async scenarios should use EntriesAsync with await foreach for proper async enumeration.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This pull request adds comprehensive async benchmarks and updates documentation to clarify async API usage in the SharpCompress performance suite. It introduces async variants for all major archive operations (read and write) across supported formats, and updates documentation to guide users on when to use async APIs and common pitfalls.
Async Benchmarking Enhancements:
GZipBenchmarks.cs,RarBenchmarks.cs,SevenZipBenchmarks.cs,TarBenchmarks.cs, andZipBenchmarks.cs, covering both Archive and Reader APIs as well as write scenarios. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]Documentation Updates:
AGENTS.mdto document new async factory methods (OpenAsyncArchive,OpenAsyncReader,OpenAsyncWriter) and provide guidance on async usage patterns and pitfalls. [1] [2] [3]README.mdfor the performance benchmarks to clearly indicate coverage of both sync and async scenarios for each archive format.Benchmark Configuration Improvements:
Codebase Preparation:
using System.Threading.Tasks;directives to all affected benchmark files to support async methods. [1] [2] [3] [4] [5]