• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

SSD, compact.exe saves filesize %, what about over-provision ?

Joined
Jan 29, 2023
Messages
1,547 (2.13/day)
Location
France
System Name KLM
Processor 7800X3D
Motherboard B-650E-E Strix
Cooling Arctic Cooling III 280
Memory 16x2 Fury Renegade 6000-32
Video Card(s) 4070-ti PNY
Storage 500+512+8+8+2+1+1+2+256+8+512+2
Display(s) VA 32" 4K@60 - OLED 27" 2K@240
Case 4000D Airflow
Audio Device(s) Edifier 1280Ts
Power Supply Shift 1000
Mouse 502 Hero
Keyboard K68
Software EMDB
Benchmark Scores 0>1000
If compact.exe can compress a file(s) to 15/45% less his original size (when simply copied), my question is what about this gained space, did it count as written space to the hardware, and SSD things it's full ?..

... so if an SSD is 99% full, using compact.exe if lucky can get back 40% of the total space (so it's only 60% full after), then the question is about the empty space after compression why can't it be found/used by the SSD (overprovision...) ?

//

What's in all those empty data, i mean, a 50 gb file is given... then compact.exe compresses it to 35% less written space being now 35 gb, why the file is 50 gb in the first place, what's an empty data doing there ?.. why does empty thing

takes place, why the non compressed file is huge, is it emptyness ?



I'd like to understand a bit, thanks.
 
Joined
Aug 19, 2024
Messages
443 (2.79/day)
Location
Texas, USA
System Name Obliterator
Processor Ryzen 7 7700x PBO
Motherboard ASRock x670e Steel Legend
Cooling Noctua NH-D15 G2 LBC
Memory G.skill Trident Z5 Neo 6000@CL30
Video Card(s) ASRock rx7900 GRE Steel Legend
Storage 2 x 2TB Samsung 990 pro nmve ssd 2 X 4TB Samsung 870 evo sata ssd 1 X 18TB WD Gold sata hdd
Display(s) LG 27GN750-B
Case Fractal Torrent
Audio Device(s) Klipsch promedia heritage 2.1
Power Supply FSP Hydro TI 1000w
Mouse SteelSeries Prime+
Keyboard Lenovo SK-8825 (L)
Software Windows 10 Enterprise LTSC 21H2 / Windows 11 Enterprise LTSC 24H2 with multiple flavors of VM
Data Compression

LZW

Huffman Compression

how file compression works

This is an over-simplification.

60gb hdd (or ssd) with a 50gb data file, so 10gb of free space. Data file compressed to 40gb, so now you have 20gb free space.

You would be able to use that 20gb of free space, and it would be 20gb of free space, since the 50gb file is only 40gb now.

If you added another file to the drive that was 15 gb (so only 5gb free space now), then you would be unable to decompress the large file until sufficient space was available.
... so if an SSD is 99% full, using compact.exe if lucky can get back 40% of the total space (so it's only 60% full after), then the question is about the empty space after compression why can't it be found/used by the SSD (overprovision...) ?
It wasn't empty space until you compressed it. Overprovisioning is a totally different thing.

Overprovisioning

Perhaps you are asking "why isn't it compressed as much as it can be from the start?", and that can be done, but there is some serious system overhead involved in real-time compresssion/decompression.

Real time compression - this article is specifically about IBM real time compression, but has it great info about the subject in general and storage footprint reduction.
 
Last edited:
Joined
Feb 11, 2015
Messages
149 (0.04/day)
As far as I know, only SandForce's SSD controllers used compression, years ago:

Files that are compressible aren't empty, usually. They're just compressible.
Compression is used in a lot of data formats, and in some networking protocols, but it's not always practical because of various factors.

For example, no compression means using less processing power, or less electric power, or having the ability to read or write data randomly and in small chunks (possibly 1-byte precision), or less latency, or better recoverability in case of corruption. So it's a compromise, used when saving space or bandwidth is more important.

Some formats that use compression:
JPEG, PNG, GIF, WebP, MPEG* video and audio, Vorbis, Opus, FLAC, RAR, 7Z, ZIP and many formats that use ZIP like DOCX, APK, JAR...
 
Last edited:
Joined
Apr 12, 2013
Messages
7,612 (1.77/day)
so if an SSD is 99% full, using compact.exe if lucky can get back 40% of the total space
You won't save that much even if you're lucky, the biggest savings are from executables/binary files & you can't compress most of them on a System drive. The compression for regular media files won't work as you have to transcode or convert them, regular NTFS compression will only save you a very small amount.
takes place, why the non compressed file is huge, is it emptyness ?
The difference mainly comes from the default allocation size vs actual amount used by files, also a lot of space used to be wasted because of default sector size back in the day for HDD's ~
Screenshot.png
 
Joined
Jan 3, 2021
Messages
3,734 (2.52/day)
Location
Slovenia
Processor i5-6600K
Motherboard Asus Z170A
Cooling some cheap Cooler Master Hyper 103 or similar
Memory 16GB DDR4-2400
Video Card(s) IGP
Storage Samsung 850 EVO 250GB
Display(s) 2x Oldell 24" 1920x1200
Case Bitfenix Nova white windowless non-mesh
Audio Device(s) E-mu 1212m PCI
Power Supply Seasonic G-360
Mouse Logitech Marble trackball, never had a mouse
Keyboard Key Tronic KT2000, no Win key because 1994
Software Oldwin
Are you just experimenting, or do you have a real use case for NTFS compression?

Most large files are compressed internally, as others have explained already. There are exceptions such as some video/audio/photo raw files and text log files - in general, anything that is meant to be changed, updated or appended. Those should NOT be compressed in the file system because any update will lead to very bad fragmentation. The main reason for fragmentation is that the compressed file size is not constant but depends on the content.

So if you identify any files that are large, never change, and are not internally compressed, those would be good candidates for NTFS compression. But I have no idea what those could be.

Apart from compact.exe, you can also turn the compression on or off in Windows GUI. It does the same thing. Right click on the file or folder, Properties, General tab, Advanced button, Compress contents to save disk space checkbox.
 
Joined
Jan 29, 2023
Messages
1,547 (2.13/day)
Location
France
System Name KLM
Processor 7800X3D
Motherboard B-650E-E Strix
Cooling Arctic Cooling III 280
Memory 16x2 Fury Renegade 6000-32
Video Card(s) 4070-ti PNY
Storage 500+512+8+8+2+1+1+2+256+8+512+2
Display(s) VA 32" 4K@60 - OLED 27" 2K@240
Case 4000D Airflow
Audio Device(s) Edifier 1280Ts
Power Supply Shift 1000
Mouse 502 Hero
Keyboard K68
Software EMDB
Benchmark Scores 0>1000
Video games compress well (i use compression on storage that have video games on it, nothing else), the max i seen was 60%, in the end on the 500 GB Steam-Deck's SSD i won 30% more free space compared too raw data.

As an exemple (not on my SD btw) "The Sinking City" needed an update to see the game size near halved (year after elease 2019-6 > 2021-1).

Depot 750132
TSCGame/Content/Paks/TSCGame-WindowsNoEditor.pak (-11.52 GiB) = this file is the full game, remaining files/binaries are about 100-150 MB

That proves the compressibles games are bad encoded data (right ?), and should always be compressed on NTFS (compress or compact.exe btw) to not loose unnecessarily storage space.

//

I read your comments, there is a lot technical stuff, i was aware of format allocation size but always used default...
... i'd never know how to know how much big/tiny files there will be stored on my disks in advance.

So, the data written, if compressible doesn't count as free space for the SSD, like it's always told to keep 10-15% free !.. that was what i wanted to understand, and it looks the answer has been no.

Thanks to all for all.
 
Last edited:
Joined
Feb 11, 2015
Messages
149 (0.04/day)
That proves the compressibles games are bad encoded data (right ?)
That's interesting. Could you post a list of some games and their pre/post NTFS-compressed sizes?
I haven't been following really, but I do recall that unlike the past, nowadays it's common for games to be wasteful, with uncompressed speech and audio, maybe textures, and more.

BTW, for files that do actually include a lot of empty regions in the middle, NTFS supports sparse files, which is distinct from compression.
Not sure there's a GUI for that because I don't think it's an everyday feature. Maybe for special uses, like scientific data, or some database types.

the biggest savings are from executables/binary files & you can't compress most of them on a System drive.
The most compressible would usually be text files (including real text, logs, HTML, XML, SQL), and after that maybe uncompressed images (BMP, PSD, and others), and uncompressed audio (like WAV).
AFAIK there shouldn't be a problem to compress Windows system files, but I haven't tried overriding what Windows does by default.

The difference mainly comes from the default allocation size vs actual amount used by files
Slack is quite minimal. The common size for clusters on NTFS is 4K, but even if it were, let's say, 16K, that's not too bad.

I checked the Windows directory here. The average file size is 140K. With the default 4K cluster size, which means an average slack of 2K per file, the waste is 1.4%.
(In actuality some files are NTFS-compressed, so the on-disk size is less than the logical size.)
And other collections of files are typically larger. For example, my main software directory averages 227K/file. And data files would be much larger.

because of default sector size
Slack is governed by cluster sizes. The change in physical sector size hasn't really affected it.
Actually, clusters are usually smaller now than in the old days, because of the way NTFS works compared to FAT(32).

Those should NOT be compressed in the file system because any update will lead to very bad fragmentation.
I'm not sure about it, assuming compression is enabled on a directory tree before writing the initial files.
Appending is the same, compressed or not.
Overwriting in the middle, I'm guessing normally it wouldn't radically change the compressibility of the block. Though that indeed depends on the nature of the file.

But anyway, fragmentation is less of an issue on SSDs (although apparently it's still beneficial to minimize it).
 
Last edited:
Joined
Aug 20, 2007
Messages
21,642 (3.40/day)
Location
Olympia, WA
System Name Pioneer
Processor Ryzen 9 9950X
Motherboard GIGABYTE Aorus Elite X670 AX
Cooling Noctua NH-D15 + A whole lotta Sunon, Phanteks and Corsair Maglev blower fans...
Memory 64GB (2x 32GB) G.Skill Flare X5 @ DDR5-6000 CL30
Video Card(s) XFX RX 7900 XTX Speedster Merc 310
Storage Intel 5800X Optane 800GB boot, +2x Crucial P5 Plus 2TB PCIe 4.0 NVMe SSDs
Display(s) 55" LG 55" B9 OLED 4K Display
Case Thermaltake Core X31
Audio Device(s) TOSLINK->Schiit Modi MB->Asgard 2 DAC Amp->AKG Pro K712 Headphones or HDMI->B9 OLED
Power Supply FSP Hydro Ti Pro 850W
Mouse Logitech G305 Lightspeed Wireless
Keyboard WASD Code v3 with Cherry Green keyswitches + PBT DS keycaps
Software Gentoo Linux x64 / Windows 11 Enterprise IoT 2024
There's also the core reason games generally do not use (much) compression: it incurs cpu overhead on read and this does NOT help fps or latency. So no, not everyone should do it.
 
Joined
Feb 11, 2015
Messages
149 (0.04/day)
Audio decompression is cheap anyway. And you're not playing/mixing too many tracks at the same time. And if stored in RAM, you want to minimize it.
Textures might be faster to send to the GPU compressed.

It may have changed with SSDs, but on HDDs there's also a benefit to minimizing the size of the data you need to stream-read.
 
Last edited:
Joined
Aug 19, 2024
Messages
443 (2.79/day)
Location
Texas, USA
System Name Obliterator
Processor Ryzen 7 7700x PBO
Motherboard ASRock x670e Steel Legend
Cooling Noctua NH-D15 G2 LBC
Memory G.skill Trident Z5 Neo 6000@CL30
Video Card(s) ASRock rx7900 GRE Steel Legend
Storage 2 x 2TB Samsung 990 pro nmve ssd 2 X 4TB Samsung 870 evo sata ssd 1 X 18TB WD Gold sata hdd
Display(s) LG 27GN750-B
Case Fractal Torrent
Audio Device(s) Klipsch promedia heritage 2.1
Power Supply FSP Hydro TI 1000w
Mouse SteelSeries Prime+
Keyboard Lenovo SK-8825 (L)
Software Windows 10 Enterprise LTSC 21H2 / Windows 11 Enterprise LTSC 24H2 with multiple flavors of VM
compression is a neat topic. lots of fancy math be mathing.
 
Joined
Feb 11, 2015
Messages
149 (0.04/day)
Though filesystem-style compression is quite limited in innovation or progress, because it must be lossless, all-purpose, and needs to still provide random access.
Also, storage and bandwidth are getting cheaper.

(Still, it would be nice for games not be so wasteful. They don't have to be 96KB like .kkrieger, but at least delete before release the 10GB of unused resources, and maybe make updates include just the delta?)
 
Last edited:
Joined
Jul 5, 2013
Messages
28,760 (6.81/day)
There's also the core reason games generally do not use (much) compression: it incurs cpu overhead on read and this does NOT help fps or latency. So no, not everyone should do it.
While true, it's almost trivial at this point and many people would rather have compression and smaller install sizes.
 
Joined
Jan 29, 2023
Messages
1,547 (2.13/day)
Location
France
System Name KLM
Processor 7800X3D
Motherboard B-650E-E Strix
Cooling Arctic Cooling III 280
Memory 16x2 Fury Renegade 6000-32
Video Card(s) 4070-ti PNY
Storage 500+512+8+8+2+1+1+2+256+8+512+2
Display(s) VA 32" 4K@60 - OLED 27" 2K@240
Case 4000D Airflow
Audio Device(s) Edifier 1280Ts
Power Supply Shift 1000
Mouse 502 Hero
Keyboard K68
Software EMDB
Benchmark Scores 0>1000
That's interesting. Could you post a list of some games and their pre/post NTFS-compressed sizes?
I haven't been following really, but I do recall that unlike the past, nowadays it's common for games to be wasteful, with uncompressed speech and audio, maybe textures, and more.

CompactGUI has a DB:

Git
 
Joined
Feb 1, 2019
Messages
3,755 (1.72/day)
Location
UK, Midlands
System Name Main PC
Processor 13700k
Motherboard Asrock Z690 Steel Legend D4 - Bios 13.02
Cooling Noctua NH-D15S
Memory 32 Gig 3200CL14
Video Card(s) 4080 RTX SUPER FE 16G
Storage 1TB 980 PRO, 2TB SN850X, 2TB DC P4600, 1TB 860 EVO, 2x 3TB WD Red, 2x 4TB WD Red
Display(s) LG 27GL850
Case Fractal Define R4
Audio Device(s) Soundblaster AE-9
Power Supply Antec HCG 750 Gold
Software Windows 10 21H2 LTSC
When I last tried NTFS compression, it had a pretty bad flaw, maybe its fixed in 11, dont know. But basically it will write uncompressed first, then compress and rewrite, so you increase your writes.
 
Joined
Jan 29, 2023
Messages
1,547 (2.13/day)
Location
France
System Name KLM
Processor 7800X3D
Motherboard B-650E-E Strix
Cooling Arctic Cooling III 280
Memory 16x2 Fury Renegade 6000-32
Video Card(s) 4070-ti PNY
Storage 500+512+8+8+2+1+1+2+256+8+512+2
Display(s) VA 32" 4K@60 - OLED 27" 2K@240
Case 4000D Airflow
Audio Device(s) Edifier 1280Ts
Power Supply Shift 1000
Mouse 502 Hero
Keyboard K68
Software EMDB
Benchmark Scores 0>1000
When I last tried NTFS compression, it had a pretty bad flaw, maybe its fixed in 11, dont know. But basically it will write uncompressed first, then compress and rewrite, so you increase your writes.

Yes, writes, in my case the games i play on S-Deck are up-to-date and won't update, so it's good, in cases files are rewitten, it's not the best idea, also it's compact.exe i use so i compress only folders i want when/if i want.
 
Joined
Apr 12, 2013
Messages
7,612 (1.77/day)
The most compressible would usually be text files (including real text, logs, HTML, XML, SQL), and after that maybe uncompressed images (BMP, PSD, and others), and uncompressed audio (like WAV).
AFAIK there shouldn't be a problem to compress Windows system files, but I haven't tried overriding what Windows does by default.
Yes, on average probably, but you rarely get massive log/text files on consumer systems. I'm talking about probably a typical home system drive; the biggest savings I've seen are on binary files in my experience.

You can't compress them while they're in use; even if you somehow manage to boot into another WinPE environment, there could be issues if those files aren't supposed to be compressed. Like pagefile & hibernation files are compressed when you do run compact on the entire C:\ drive, but the system will either reinitialize/recreate the pagefile without compression or create a new one, & hibernation won't work as long as that file is compressed. Just an example with respect to system files, this also applies to anything in the Windows folder.

Just to be clear, I'm talking about the additional flag ~
compact /exe
That will save you (lot) more than regular NTFS compression.
 
Last edited:
Joined
Jul 5, 2013
Messages
28,760 (6.81/day)
When I last tried NTFS compression, it had a pretty bad flaw, maybe its fixed in 11, dont know. But basically it will write uncompressed first, then compress and rewrite, so you increase your writes.
Um, no. It's not fixed. Don't use NTFS compression.
 
Top