Windows 10 Compression

Discussion in 'Windows 10' started by Flipp3r, Apr 21, 2015.

  1. Superfly

    Superfly MDL Expert

    Jan 12, 2010
    1,142
    543
    60
    #61 Superfly, May 26, 2015
    Last edited by a moderator: Apr 20, 2017
    Code:
    C:\WINDOWS\system32>compact /compactos
    The system is not in the Compact state because Windows has determined that, it
    is not beneficial for this system.
    LOL...Well, thank you... big brother :rolleyes:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. burfadel

    burfadel MDL EXE>MSP/CAB

    Aug 19, 2009
    2,626
    3,856
    90
    #62 burfadel, May 26, 2015
    Last edited by a moderator: Apr 20, 2017
    Did they put that command after 'that', or was that you? It's not meant to be there.

    Basically that should only show if the detected CPU isn't considered up to the task of on-the-fly decompression. Not sure how this translate to the real world though in terms of performance.
     
  3. gabrielmorrow

    gabrielmorrow MDL Member

    Jul 5, 2013
    193
    15
    10
    #63 gabrielmorrow, May 26, 2015
    Last edited: May 26, 2015
    type compact /compactos:always and see how much your save

    compression ratio is 1.6 to 1
     
  4. burfadel

    burfadel MDL EXE>MSP/CAB

    Aug 19, 2009
    2,626
    3,856
    90
    #64 burfadel, May 26, 2015
    Last edited: May 26, 2015
    I know :). I just wish there was an option somehow to make xpress16K the default instead of Xpress4k. Of course, you can select Xpress16K elsewhere, but for the system files Xpress4K is currently the only option. Xpress16K actually compresses noticeably better, and in some tests I did on games, was actually faster for me! Compression takes a bit longer, but decompression is extremely fast.

    The other issue is that you can actually attribute folders to compress the files in the new format (I don't mean NTFS file compression), but again it only sets them to the default Xpress4K. You can't choose to compress new files to those folders automatically to Xpress16K.
     
  5. Superfly

    Superfly MDL Expert

    Jan 12, 2010
    1,142
    543
    60
    #65 Superfly, May 26, 2015
    Last edited by a moderator: Apr 20, 2017
    OK,. after running the two commands this is what I get...

    Code:
    C:\WINDOWS\system32>compact /compactos:always
    Completed Compressing OS binaries.
    
    34422 files within 14065 directories were compressed.
    5 752 651 481 total bytes of data are stored in 3 473 015 439 bytes.
    
    The compression ratio is 1,7 to 1.
    
    C:\WINDOWS\system32>compact /exe:XPRESS16K
    Of 3805 files within 1 directories
    3451 are compressed and 354 are not compressed.
    1 641 540 739 total bytes of data are stored in 1 035 696 691 bytes.
    The compression ratio is 1,6 to 1.
    Capture.PNG
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. xinso

    xinso MDL Guru

    Mar 5, 2009
    13,681
    14,418
    340
    #66 xinso, May 26, 2015
    Last edited by a moderator: Apr 20, 2017
    Does this mean my 10125 System has been compressed with installation?

    Code:
    C:\WINDOWS\system32>compact /compactos:always
    Completed Compressing OS binaries.
    
    14606 files within 17545 directories were compressed.
    484,221,678 total bytes of data are stored in 479,478,291 bytes.
    The compression ratio is 1.0 to 1.
     
  7. Superfly

    Superfly MDL Expert

    Jan 12, 2010
    1,142
    543
    60
    Seems like it does.. that I ran on 10122 - I have now did an in-place upgrade to 10125 - now I get this without running any commands... it's even more compressed ;)

    Capture2.PNG
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. burfadel

    burfadel MDL EXE>MSP/CAB

    Aug 19, 2009
    2,626
    3,856
    90
    #68 burfadel, May 26, 2015
    Last edited by a moderator: Apr 20, 2017
    That command, 'compact /exe:xpress16k', won't actually do anything. It wilk just show you the current stats of the files. That said, you definitely shot NOT manually compress the system32 folder. You won't be able to boot Windows if you do!

    Also, if you run it a second time, it will only run on files not already compressed. These are most likely files that don't compress well anyway, and the compression program is 'smart' enough to see this. If an 8 MB file has a 200 byte saving with compression, the uncompressed version will remain (the compressed copy will be discarded). If you run compact again, this same file will be reprocessed as it isn't compressed. After the process, compact won't look that impressive since it's only processed the uncompressed files... the files that were kept uncompressed to begin with.

    So, first time with compact /compactos:always will show a good improvement (if not already compressed), the second time will show little or no improvement, unless files were added or changed in the meantime. The same goes for any other folder processed.
     
  9. gabrielmorrow

    gabrielmorrow MDL Member

    Jul 5, 2013
    193
    15
    10
    compress:always also marks the folder so that if you install new hotfixes etc the files added will be compressed
     
  10. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    17,194
    90,692
    340
    #70 abbodi1406, May 26, 2015
    Last edited by a moderator: Apr 20, 2017
  11. Superfly

    Superfly MDL Expert

    Jan 12, 2010
    1,142
    543
    60
    #71 Superfly, May 26, 2015
    Last edited: May 26, 2015
    Just to be clear - only the event log files in System32 gets compressed.

    EDIT: Actually the above is not accurate - it's quite selective what it compresses. Eg: SPP gets compressed except for store... obviously neither does boot etc either...

    Capture3.PNG
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  12. burfadel

    burfadel MDL EXE>MSP/CAB

    Aug 19, 2009
    2,626
    3,856
    90
    The difference is that NTFS compression code is one of the first things loaded in the system. The Windows 10 compression code is loaded at a later point in the boot cycle, which means files loaded before this cannot be compressed. This is the reason why many files in the system32 folder are not compressed. The compact program only compressed the files that are safe to be done. It's just a little unfortunate that you cannot, or at least there is no way currently known, to change the system default to Xpress16K.
     
  13. burfadel

    burfadel MDL EXE>MSP/CAB

    Aug 19, 2009
    2,626
    3,856
    90
    I know, but only as Xpress4k, not Xpress16K.

    Xpress16K is much better compression. Slightly slower on the compress due to the finding algorithm, but just as fast decompressing since decompressing is 'easy' :). Xpress16K can at times actually be faster!
     
  14. johnathonm

    johnathonm MDL Novice

    Aug 3, 2012
    13
    4
    0
    Hi Burfadel,

    If you need a tester for your app I would be glad to help. This sounds like it could be a very cool piece of kit when it's done!

    J:clap:
     
  15. ZaForD

    ZaForD MDL Expert

    Jan 26, 2008
    1,209
    200
    60
    I just installed 10130 on my Stream 7 and noticed a few things, that maybe of interest to you guys.

    1. With a clean install, 10130 didn't compress the OS. I had a 12gb install with 17gb free.
    The last few times its done a compressed install.

    2. I used the compact /compactos:always command, which gave me back around 2gb.

    3. I did a DISM install with the /compact switch. This left me with over 20gb free.

    Is that down to the 4K - 16K compression Burfadel is talking about ?
     
  16. burfadel

    burfadel MDL EXE>MSP/CAB

    Aug 19, 2009
    2,626
    3,856
    90
    The script is still WIP. I could have done it the simple easy way, but I decided to go a better way :). I've actually been away for a few weeks and just got back, I hope to have the final out before the 29 July release. I also hope to get to finishing the new Windows update installer script, which will be Windows 10 only. The reason for this is Windows 7 and 8.1 just got too complex with the update ordering etc, Microsoft have supposedly improved this with Windows 10.
     
  17. Pointy

    Pointy MDL Junior Member

    May 11, 2015
    95
    11
    0
    #77 Pointy, Jul 21, 2015
    Last edited: Jul 21, 2015
    so if you would like to compress a certain directory
    cd to that place
    then use compact /s /c /f /exe:xpress16k( or one of the other options)
    this will compress all files in the current directory your in

    the compression ratios for xpress16k are great.

    sorry if this has been said somehwhere before
    and I believe that this also makes it so that all new files in that directory will be compressed with xpress16k too
    correct me if I am wrong
    also do not do this if you don't know what your doing
    somebody has said on page 3 or 4 not to compress your system with it
     
  18. darius510

    darius510 MDL Novice

    Dec 26, 2014
    6
    0
    0
    Here's a simple script for now. Just put this in a batch file, and create a shortcut in the sendto folder. The just right click the folder/s you want to compress.

    :MainLoop
    pushd %1
    compact /C /S /EXE:XPRESS4K /I /F
    shift
    if not "%~1"=="" goto MainLoop
    pause

    Should be obvious how to modify it to suit the level of compression you want, or to make it uncompress. Don't do this to your windows folder unless you don't like booting. But if you want to squeeze down any new windows files in a safe way since the last time it was compressed, just type at a command line:

    compact /compactos:always

    And it'll get to work.

    Love this functionality, I really wish it was better integrated into explorer though. But for now these batches do the job.
     
  19. darius510

    darius510 MDL Novice

    Dec 26, 2014
    6
    0
    0
    One thing I would find very useful in a more full fledged script/utility is if it would record the compression ratio of files and selectively uncompress them if they're below a certain threshold. I've tested it and there is a performance hit on files with low compression ratios. Ideally this would also kill two birds with one stone, where on a future compression pass it would already know a file can't be well compressed and to just skip it. Right now it's especially annoying that when a file doesnt compress at all, it's not marked by the system as compressed like it is with NTFS compression. Any time you repeat the command against incompressible files, it goes through the motions of compressing them all over again, just to find out that they're incompressible.
     
  20. shot²

    shot² MDL Junior Member

    Feb 20, 2011
    60
    37
    0
    ... which is fortunate on my system, whereby the SSD (system drive) already implements some compression algorithms internally (SandForce-based models...)

    Not every compression is always welcome :mushy: as for this specific case, both volume-compression (Compact™) and volume-encryption (Bitlocker™) would consume power & cycles for ~0 results.