Skip to content

Slow zip archive extracting when install zig compiler #3505

Open

Description

Brief description of your issue

While installing zig compiler Extracting archive step takes a lot of time.
Reported in #3306 as well.

Steps to reproduce

  1. Run winget install -e --id zig.zig
  2. Wait until complete

Expected behavior

Speed up extraction

Actual behavior

Extracting took ~8 minutes with Winget.

Both major archive programs (7Zip and WinRAR) took around ~30 sec to do the same. Which is huge (x20 times) difference in time!

Environment

Windows Package Manager v1.5.1881
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.22621.2070
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.20.1881.0

Winget Directories
-----------------------------------------------------------------------------------------------------------------------
Logs                               %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\Diag…
User Settings                      %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\sett…
Portable Links Directory (User)    %LOCALAPPDATA%\Microsoft\WinGet\Links
Portable Links Directory (Machine) C:\Program Files\WinGet\Links
Portable Package Root (User)       %LOCALAPPDATA%\Microsoft\WinGet\Packages
Portable Package Root              C:\Program Files\WinGet\Packages
Portable Package Root (x86)        C:\Program Files (x86)\WinGet\Packages

Links
---------------------------------------------------------------------------
Privacy Statement   https://aka.ms/winget-privacy
License Agreement   https://aka.ms/winget-license
Third Party Notices https://aka.ms/winget-3rdPartyNotice
Homepage            https://aka.ms/winget
Windows Store Terms https://www.microsoft.com/en-us/storedocs/terms-of-sale

Admin Setting                             State
--------------------------------------------------
LocalManifestFiles                        Disabled
BypassCertificatePinningForMicrosoftStore Disabled
InstallerHashOverride                     Disabled
LocalArchiveMalwareScanOverride           Disabled

======================================================
Device name	NOGRPC
Processor	AMD Ryzen 5 1600 Six-Core Processor               3.17 GHz
Installed RAM	16.0 GB
Storage: Samsung SSD 980 PRO with Heatsink 1TB

Activity

  1. MagicAndre1981 commented on Aug 6, 2023

    @MagicAndre1981

    Issue is defender which scans the zip

    image

    Line # Process Stack Count Weight (in view) (ms) % Weight
    1 winget.exe (14880)   29930 29.966,377600 5,39
    2   [Root] 28873 28.907,194200 5,20
    3   |- ntdll.dll!RtlUserThreadStart 28844 28.878,052900 5,20
    4   |    kernel32.dll!BaseThreadInitThunk 28844 28.878,052900 5,20
    5   |    |- combase.dll!CRpcThreadCache::RpcWorkerThreadEntry 27641 27.672,781000 4,98
    6   |    |    combase.dll!CRpcThread::WorkerLoop 27641 27.672,781000 4,98
    7   |    |    combase.dll!CDllHost::WorkerThread 27641 27.672,781000 4,98
    8   |    |    combase.dll!CDllHost::STAWorkerLoop 27641 27.672,781000 4,98
    9   |    |    |- user32.dll!DispatchMessageWorker 27640 27.671,781000 4,98
    10   |    |    |    user32.dll!UserCallWinProcCheckWow 27640 27.671,781000 4,98
    11   |    |    |    combase.dll!ThreadWndProc 27640 27.671,781000 4,98
    12   |    |    |    combase.dll!ComInvokeWithLockAndIPID 27640 27.671,781000 4,98
    13   |    |    |    combase.dll!ReentrantSTAInvokeInApartment 27640 27.671,781000 4,98
    14   |    |    |    combase.dll!ServerCall::ContextInvoke 27640 27.671,781000 4,98
    15   |    |    |    combase.dll!SyncServerCall::StubInvoke 27640 27.671,781000 4,98
    16   |    |    |    combase.dll!DefaultStubInvoke 27640 27.671,781000 4,98
    17   |    |    |    combase.dll!ObjectMethodExceptionHandlingAction<<lambda_c9f3956a20c9da92a64affc24fdd69ec> > 27640 27.671,781000 4,98
    18   |    |    |    |- rpcrt4.dll!CStdStubBuffer_Invoke 27632 27.663,781200 4,98
    19   |    |    |    |    combase.dll!CStdStubBuffer_Invoke 27632 27.663,781200 4,98
    20   |    |    |    |    rpcrt4.dll!NdrStubCall3 27632 27.663,781200 4,98
    21   |    |    |    |    rpcrt4.dll!Ndr64StubWorker 27632 27.663,781200 4,98
    22   |    |    |    |    |- rpcrt4.dll!Invoke 27631 27.662,786400 4,98
    23   |    |    |    |    |    |- windows.storage.dll!CFileOperation::PerformOperations 24919 24.950,490000 4,49
    24   |    |    |    |    |    |    |- windows.storage.dll!CFileOperation::PrepareAndDoOperations 24918 24.949,458000 4,49
    25   |    |    |    |    |    |    |    |- windows.storage.dll!CFileOperation::_EnumRootDo 22047 22.078,134500 3,97
    26   |    |    |    |    |    |    |    |    windows.storage.dll!CRecursiveFolderOperation::Do 22047 22.078,134500 3,97
    27   |    |    |    |    |    |    |    |    |- windows.storage.dll!CCopyWorkItem::ProcessWorkItem 22046 22.077,134500 3,97
    28   |    |    |    |    |    |    |    |    |    |- windows.storage.dll!CCopyWorkItem::_ProcessChildren 22040 22.071,043100 3,97
    29   |    |    |    |    |    |    |    |    |    |    |- windows.storage.dll!CCopyWorkItem::ProcessWorkItem 22038 22.069,043100 3,97
    30   |    |    |    |    |    |    |    |    |    |    |    |- windows.storage.dll!CCopyWorkItem::_ProcessChildren 20894 20.924,939800 3,76
    31   |    |    |    |    |    |    |    |    |    |    |    |    |- windows.storage.dll!CCopyWorkItem::ProcessWorkItem 20888 20.918,929700 3,76
    32   |    |    |    |    |    |    |    |    |    |    |    |    |    |- windows.storage.dll!CCopyWorkItem::_ProcessChildren 20732 20.762,846400 3,74
    33   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |- windows.storage.dll!CCopyWorkItem::ProcessWorkItem 20502 20.532,491000 3,69
    34   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |- windows.storage.dll!CCopyWorkItem::_ProcessChildren 13666 13.688,198500 2,46
    35   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |- windows.storage.dll!CCopyWorkItem::ProcessWorkItem 13584 13.606,034700 2,45
    36   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |- windows.storage.dll!CCopyWorkItem::_ProcessChildren 11706 11.724,882300 2,11
    37   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |- windows.storage.dll!CCopyWorkItem::ProcessWorkItem 11525 11.543,569900 2,08
    38   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |- windows.storage.dll!CCopyWorkItem::_ProcessChildren 6870 6.881,567000 1,24
    39   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |- windows.storage.dll!CCopyWorkItem::ProcessWorkItem 6700 6.711,137700 1,21
    40   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |- windows.storage.dll!CCopyWorkItem::_SetupAndPerformOp 3750 3.754,999500 0,68
    41   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |- windows.storage.dll!CCopyWorkItem::_DoOperation 3728 3.732,884200 0,67
    42   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |- windows.storage.dll!CCopyOperation::Do 3273 3.278,219900 0,59
    43   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |- windows.storage.dll!CCopyOperation::_CreateDestinationOrCopyItemWithRetry 3071 3.075,968900 0,55
    44   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |- zipfldr.dll!CZipTransfer::CopyItem 2972 2.976,732900 0,54
    45   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |- zipfldr.dll!ExtractZipToFile 2942 2.946,713400 0,53
    46   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |- zipfldr.dll!CArchiveIDList::ExtractFromZipToFile 2941 2.945,712500 0,53
    47   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |- zipfldr.dll!CheckUnZippedFile 2560 2.563,526500 0,46
    48   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |- shdocvw.dll!CAttachmentServices::_SaveHelper 2536 2.539,527800 0,46
    49   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |- shdocvw.dll!CAttachmentServices::_OpAntiVirus 1492 1.492,683600 0,27
    50   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |- shdocvw.dll!_SHExtCoCreateInstanceAndScan 1476 1.476,709100 0,27
    51   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |- MpOAV.dll! 1466 1.466,734400 0,26
    52   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    MpOAV.dll! 1466 1.466,734400 0,26
    53   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |- MpOAV.dll! 1160 1.160,770000 0,21
    54   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |- MpOAV.dll! 820 820,467000 0,15
    55   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |- MpClient.dll! 465 465,342400 0,08

    zipfldr.dll!ExtractZipToFile calls zipfldr.dll!CheckUnZippedFile which later calls shdocvw.dll!CAttachmentServices::_OpAntiVirus and shdocvw.dll!_SHExtCoCreateInstanceAndScan and this calls Defender functions from MpOAV.dll and MpClient.dll

  2. added
    Area-Performance
    Issue-Bug
    and removed
    Needs-Triage
    on Aug 7, 2023
  3. InternalHigh commented on Dec 31, 2023

    @InternalHigh

    Can you replace usage of zipfldr.dll with a decent implementation?

  4. pedrohgmacedo commented on May 5, 2024

    @pedrohgmacedo

    I'm having this problem. I have windows defender turned off, and it still takes more than 1 minute to extract a file.

  5. gonchik commented on Jun 26, 2024

    @gonchik

    Nice shot! Thank you!

  6. Xyndra commented on Aug 7, 2024

    @Xyndra

    Why does this still remain after a year of the issue being created. This is literally a Microsoft package and a Microsoft Defender / Unzipping problem this should be easily solvable!

  7. zveinn commented on Sep 26, 2024

    @zveinn

    just wanted to bump this. Experienced the same slowness on up to date Win11 using Powershell + winget
    Started the winget install 3 minutes ago and it's still going.

  8. TylerAustinW commented on Sep 27, 2024

    @TylerAustinW

    The person above me is.... still..... installing it.... a day later 🤣

  9. zveinn commented on Sep 27, 2024

    @zveinn

    1 million hours and counting

  10. prcastro commented on Oct 26, 2024

    @prcastro

    This issue is easily reproducible

  11. 720720 commented on Jan 6, 2025

    @720720

    https://aka.ms/winget-settings

    winget settings

    %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json

    {
        "$schema": "https://aka.ms/winget-settings.schema.json",
    
        "installBehavior": {
            "archiveExtractionMethod": "tar"
        }
    }
    
  12. GitMurf commented on Jan 8, 2025

    @GitMurf
    {
        "$schema": "https://aka.ms/winget-settings.schema.json",
    
        "installBehavior": {
            "archiveExtractionMethod": "tar"
        }
    }
    

    Wow this fixed it for me! Took about 10 seconds to install zig instead of 10 minutes!!

  13. yhslai commented on Mar 26, 2026

    @yhslai

    That's ridiculous. I mean it's expected as Microsoft can't even take care of their OS, let alone a package manager.

    By the way if you install the exact same thing with scoop it takes seconds.

  14. denelon commented on Apr 29, 2026

    @denelon
    Collaborator

    Potentially Correlated Issues

    The following open issues appear related to the same underlying performance limitations in archive extraction:

    Note

    These potentially correlated issues were identified using GitHub Copilot CLI as a research tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-PerformanceIssue-Bug

    Type

    Projects

    • Status
      No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions