[PR #907] [MERGED] Optimize LZ OutWindow.CopyBlock #1332

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

📋 Pull Request Information

Original PR: https://github.com/adamhathcock/sharpcompress/pull/907
Author: @jdpurcell
Created: 3/19/2025
Status: Merged
Merged: 3/20/2025
Merged by: @adamhathcock

Base: masterHead: pr-copyblockoptim


📝 Commits (1)

  • c2d9bf9 Optimize LZ OutWindow.CopyBlock

📊 Changes

1 file changed (+37 additions, -17 deletions)

View changed files

📝 src/SharpCompress/Compressors/LZMA/LZ/LzOutWindow.cs (+37 -17)

📄 Description

After a bit of profiling, this function seemed like a good candidate for optimization. Testing on a large-ish archive (412 MB), I'm seeing extraction times like:

CPU Before After % of Original
Apple M3 31.1 s 26.8 s 86%
Core i7-6700k 37.2 s 33.8 s 91%

🔄 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/907 **Author:** [@jdpurcell](https://github.com/jdpurcell) **Created:** 3/19/2025 **Status:** ✅ Merged **Merged:** 3/20/2025 **Merged by:** [@adamhathcock](https://github.com/adamhathcock) **Base:** `master` ← **Head:** `pr-copyblockoptim` --- ### 📝 Commits (1) - [`c2d9bf9`](https://github.com/adamhathcock/sharpcompress/commit/c2d9bf94d12d428a01442052cf49a7efeff62186) Optimize LZ OutWindow.CopyBlock ### 📊 Changes **1 file changed** (+37 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `src/SharpCompress/Compressors/LZMA/LZ/LzOutWindow.cs` (+37 -17) </details> ### 📄 Description After a bit of profiling, this function seemed like a good candidate for optimization. Testing on a [large-ish archive](https://download.qt.io/online/qtsdkrepository/mac_x64/desktop/qt6_682/qt6_682/qt.qt6.682.clang_64/6.8.2-0-202501260836qtdeclarative-MacOS-MacOS_14-Clang-MacOS-MacOS_14-X86_64-ARM64.7z) (412 MB), I'm seeing extraction times like: |CPU|Before|After|% of Original| |-|-|-|-| |Apple M3|31.1 s|26.8 s|86%| |Core i7-6700k|37.2 s|33.8 s|91%| --- <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:20:03 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#1332