Skip to content

Add JB perf testing project.#969

Merged
adamhathcock merged 16 commits intomasterfrom
adam/perf
Oct 23, 2025
Merged

Add JB perf testing project.#969
adamhathcock merged 16 commits intomasterfrom
adam/perf

Conversation

@adamhathcock
Copy link
Owner

@adamhathcock adamhathcock commented Oct 23, 2025

Got some memory allocation wins with RAR
Pooling for LZMA reading

Testing for more low hanging fruit...

@adamhathcock adamhathcock requested a review from Copilot October 23, 2025 10:44
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new performance testing project to help identify and address memory allocation bottlenecks in SharpCompress. The primary focus is on optimizing RAR decompression through ArrayPool usage and other performance improvements.

Key changes:

  • Added new SharpCompress.Performance project with JetBrains profiler integration for CPU and memory analysis
  • Implemented ArrayPool-based memory pooling for BitInput and RarVM to reduce allocations
  • Optimized RAR unpacking algorithms and LZMA decompression with better resource disposal
  • Simplified unsigned right shift operations and improved array operations efficiency

Reviewed Changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
tests/SharpCompress.Performance/* New performance testing project with profiling infrastructure
src/SharpCompress/Utility.cs Simplified unsigned right shift implementations
src/SharpCompress/NotNullExtensions.cs Added aggressive inlining to NotNullOrEmpty method
src/SharpCompress/Compressors/Rar/VM/RarVM.cs Converted to use ArrayPool for memory allocation and improved array operations
src/SharpCompress/Compressors/Rar/VM/BitInput.cs Added IDisposable with ArrayPool-based buffer management
src/SharpCompress/Compressors/Rar/UnpackV1/* Optimized decoding algorithms and cleanup, added proper disposal
src/SharpCompress/Compressors/LZMA/* Added proper disposal of OutWindow resources

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@adamhathcock adamhathcock requested a review from Copilot October 23, 2025 13:16
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

adamhathcock and others added 2 commits October 23, 2025 14:19
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant