Really bad performance.
See original GitHub issueI’m using this code.
It takes like 10 minutes to extract 272 files from a 7-zip archive that is not special by any means. Well, it’s been compressed using the Ultra setting… 😃
I has some of them that are about 80MB in size.
What could be wrong?
Thanks!!
public class DriverPackageInstaller : IDriverPackageInstaller
{
public async Task InstallDriverPackage(string fileName, string destination)
{
using (var package = SevenZipArchive.Open(fileName))
{
await Extract(package.Entries, "Cityman", @"NewPack\Pre-OOBE");
await Extract(package.Entries, "PostOOBE", @"NewPack\Post-OOBE");
}
}
public static async Task Extract(ICollection<SevenZipArchiveEntry> entries, string sourceFolder, string destinationFolder)
{
var translatedPath = sourceFolder.Replace("\\", "/");
foreach (var entry in entries.Where(x => x.Key.StartsWith(translatedPath) && !x.IsDirectory))
{
await ExtractEntryToFile(entry, sourceFolder, destinationFolder);
}
}
private static async Task ExtractEntryToFile(IArchiveEntry entry, string sourceFolder, string destination)
{
using (var input = entry.OpenEntryStream())
{
var path = entry.Key.Replace($"{sourceFolder}/", "");
var fileName = Path.GetFileName(path);
var directoryName = Path.GetDirectoryName(path);
var newFolder = Path.Combine(destination, directoryName);
var outputPath = Path.Combine(newFolder, fileName);
Directory.CreateDirectory(newFolder);
using (var output = File.OpenWrite(outputPath))
{
await input.CopyToAsync(output);
}
}
}
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
How to Fix Your Low Frame Rate
Easy Fixes for Low FPS · Close background processes. Use the Task Manager (shortcut: CTRL+SHIFT+ESC), then click the CPU and Memory tabs to...
Read more >How to Fix Low Game FPS in Windows
For an overall tweak, try lowering the Graphics Quality slider, as less-intense graphics will help the game run better. Dropping from Epic or ......
Read more >bad performance : r/TheCycleFrontier
Lower FPS in all areas, sound direction is bad. Lighting is really bad now too. 3 steps forward 2 back.
Read more >Help! Very bad performance with good PC.
Hi. I am having very bad performance in many games such as Battlefield 1 and The Division. I mean like 30-55fps on Low...
Read more >Really bad performance - low FPS and stuttering
Really bad performance - low FPS and stuttering Hey folks, I've been experiencing very low performance lately altough my PC is quite good....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@androschuk , try use var reader = archive.ExtractAllEntries(); while (reader.MoveToNextEntry()) { if (!reader.Entry.IsDirectory) { // Do something } }
https://www.nuget.org/packages/sharpcompress/0.22.0