[PR #336] [MERGED] Utility.Skip uses seek #972

Closed
opened 2026-01-29 22:18:25 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/adamhathcock/sharpcompress/pull/336
Author: @diontools
Created: 1/2/2018
Status: Merged
Merged: 1/10/2018
Merged by: @adamhathcock

Base: masterHead: ImproveStreamSkipping


📝 Commits (1)

📊 Changes

1 file changed (+6 additions, -0 deletions)

View changed files

📝 src/SharpCompress/Utility.cs (+6 -0)

📄 Description

Hello.
I have a large zip file.(~100GB 871kEntries)
I tried below code.

var sw = Stopwatch.StartNew();
using (var stream = new FileStream(@"large.zip", FileMode.Open, FileAccess.Read, FileShare.Read))
using (var reader = ZipReader.Open(stream, new SharpCompress.Readers.ReaderOptions { LeaveStreamOpen = true }))
{
    while (reader.MoveToNextEntry())
    {
        //Console.WriteLine(reader.Entry.Key);
    }
}
Console.WriteLine(sw.Elapsed);

It took about 13 minutes in my machine.
However, when this PR is applied, it was shortened to 10 seconds.
Does this cause problems?

I'm sorry for my poor English.
Thank you for reading.


🔄 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/336 **Author:** [@diontools](https://github.com/diontools) **Created:** 1/2/2018 **Status:** ✅ Merged **Merged:** 1/10/2018 **Merged by:** [@adamhathcock](https://github.com/adamhathcock) **Base:** `master` ← **Head:** `ImproveStreamSkipping` --- ### 📝 Commits (1) - [`2fd9fe9`](https://github.com/adamhathcock/sharpcompress/commit/2fd9fe96ad0a20e7d628de192603e8b72673d9a3) Utility.Skip uses seek ### 📊 Changes **1 file changed** (+6 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/SharpCompress/Utility.cs` (+6 -0) </details> ### 📄 Description Hello. I have a large zip file.(~100GB 871kEntries) I tried below code. ```csharp var sw = Stopwatch.StartNew(); using (var stream = new FileStream(@"large.zip", FileMode.Open, FileAccess.Read, FileShare.Read)) using (var reader = ZipReader.Open(stream, new SharpCompress.Readers.ReaderOptions { LeaveStreamOpen = true })) { while (reader.MoveToNextEntry()) { //Console.WriteLine(reader.Entry.Key); } } Console.WriteLine(sw.Elapsed); ``` It took about 13 minutes in my machine. However, when this PR is applied, it was shortened to 10 seconds. Does this cause problems? I'm sorry for my poor English. Thank you for reading. --- <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:18:25 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#972