question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Really bad performance.

See original GitHub issue

I’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:open
  • Created 5 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
Eriorcommented, Mar 12, 2023

@androschuk , try use var reader = archive.ExtractAllEntries(); while (reader.MoveToNextEntry()) { if (!reader.Entry.IsDirectory) { // Do something } }

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found