[PR #898] [MERGED] Implement ReadByte for LzmaStream and LzOutWindow #1325

Open
opened 2026-01-29 22:19:59 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/adamhathcock/sharpcompress/pull/898
Author: @Morilli
Created: 2/16/2025
Status: Merged
Merged: 2/17/2025
Merged by: @adamhathcock

Base: masterHead: lz-readbyte


📝 Commits (1)

  • 4b4ec12 Implement ReadByte for LzmaStream and LzOutWindow

📊 Changes

2 files changed (+95 additions, -0 deletions)

View changed files

📝 src/SharpCompress/Compressors/LZMA/LZ/LzOutWindow.cs (+19 -0)
📝 src/SharpCompress/Compressors/LZMA/LzmaStream.cs (+76 -0)

📄 Description

Similar to #897, this improves performance and reduces memory allocations when reading certain 7-zip files.

Using the .7z file from https://github.com/adamhathcock/sharpcompress/issues/399#issuecomment-405028725, I measured a speedup in reading / skipping the entire .7z file from ~23 seconds to ~18 seconds, and memory allocations dropped by ~8.5GB.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/adamhathcock/sharpcompress/pull/898 **Author:** [@Morilli](https://github.com/Morilli) **Created:** 2/16/2025 **Status:** ✅ Merged **Merged:** 2/17/2025 **Merged by:** [@adamhathcock](https://github.com/adamhathcock) **Base:** `master` ← **Head:** `lz-readbyte` --- ### 📝 Commits (1) - [`4b4ec12`](https://github.com/adamhathcock/sharpcompress/commit/4b4ec12c87d1042455abbea96450ca52620d6757) Implement ReadByte for LzmaStream and LzOutWindow ### 📊 Changes **2 files changed** (+95 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/SharpCompress/Compressors/LZMA/LZ/LzOutWindow.cs` (+19 -0) 📝 `src/SharpCompress/Compressors/LZMA/LzmaStream.cs` (+76 -0) </details> ### 📄 Description Similar to #897, this improves performance and reduces memory allocations when reading certain 7-zip files. Using the .7z file from https://github.com/adamhathcock/sharpcompress/issues/399#issuecomment-405028725, I measured a speedup in reading / skipping the entire .7z file from ~23 seconds to ~18 seconds, and memory allocations dropped by ~8.5GB. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 22:19:59 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#1325