Re: What does "Compress Contents To Save Disk Space" do?
Hi, since you asked, the subject of compression has been rarely raised, yet in computer science it is very important as it's aim is to reduce the overall number of bits & bytes in a file.The OS will use a zip program to expand the file so all it's contents can be revealed.
Some terms are common to this:- we have redundancies,Algorithms,Dictionary's, Patterns, Lossy and Lossless
Briefly let's look at each one:-
Redundancy
In this sentence "we make a living by what we get we make a life by what we give"
We see:-
we-4
make-2
a -2
by-2
what-2 So the sentence consists of "we living make a life by what give"
I do not intend to bore you by expanding on this, just you should begin to get the idea.
Using the LZ adaptive dictionary-based algorithm we have begun to build what's known as a dictonary this will be used by the zip file to expand the compressed file.
Looking for patterns we could explore our sentence more and since we are creating algorithns we can reduce it further.
The technique might be explained as lossless and is applicable to such a txt file. If however you applied this to a picture of say the ocean much would be blue so it would not condense very well. For this lossy is used it would pick the dominant pixel (blue ) and replace this.
A lossless expand is exactly the same as an original however with lossy it is impossible to reproduce the original however programs like OCR come into play (optical character recognition) this is why only the uninformed believed the fake Obama BC it is expected to look the way it did.
If you want more information Google or with a bit of luck Joe will find a tutorial for you, my notes on this remain the property of the University I wrote them for,so I cannot produce. Most of our stuff seems to have gotten onto the net, I see it often, only wish they didn't copy out of context.
The following was published on the net, the original was written by a colleague in 1999, still applies , generally agrees with what the others have said:-
Windows File Compression is a part of the NTFS file system that when enabled, automatically compresses files to take up less space. Seems simple enough, right?
As a gross oversimplification compression means replacing one representation of data with another that takes up less space. For example the string “**********” (10 asterisks) might be replaced with three characters – “10*” – meaning “ten asterisks.” When decompressed the “10*” would get transformed back into “**********.” Now, of course there are complications – for one example we need a way to make sure that if there’s a “10*” in the data before compression we don’t try to turn it into “**********” on decompression.
Suffice it to say that real compression algorithms are a complex technology, bordering on an art form.
So if good compression can “makes things smaller,” what’s the catch?
In my opinion, there are two big ones.
Compression is Work – One thing that they all compression algorithms share is that they require calculation. That means when you compress or decompress a file on your computer, your CPU needs to do more work than if the file were not compressed. Different algorithms have different characteristics – some require a great deal of CPU processing to compress the data, while the decompression can be lightning fast. Others compress comparatively poorly, but take less time to do it.
Compressing files that are already compressed doesn’t help. – A file that has already been compressed by a reasonably good compression algorithm will typically not compress well if you try to compress it again with another. In fact, in the worst case, a “compressing” a compressed file can sometimes even make it bigger. And here’s the catch within the catch: many files you use ever day are already compressed. Typically audio, video and image formats are already using compression algorithms as part of the file format. “.mp3,” “.jpg,” “.mpg” files, and similar, are all already compressed, and typically to not benefit much from attempts to compress them further.
So what should you do? When should you consider compression?
I’d consider the following:
• If the files you’re considering compressing are used infrequently, then they might be candidates. The “old files” from a disk cleanup utility probably fall into this category.
• If the files you’re considering compressing aren’t already compressed, then it could make sense. There’s no way for me to know what files disk cleanup is pointing you at, so I can’t say how this might apply to you.
• If you have a powerful enough CPU, you can compress files used more frequently. I definitely wouldn’t compress files I use frequently on an older machine. It can slow down your machine as the CPU gets more involved in every disk access.
• Realize that compressed files and compressed file systems are harder to recover in the event of a crash. Make sure that you’re appropriately backed up.
My advice? Don’t bother. Compression on average will probably recover only about 50% of the space used by files you compress. If you’re really running into space problems that have you looking at this, you’re probably better off adding a hard drive to your system.
I have no compressed file systems on any of the computers I run. I’ve done so in the past only on laptops where adding or replacing a hard drive just wasn’t in the cards for me, and only after I’ve started to run out of space and other options didn’t free up enough.
If you want to investigate file compression further, note that when using NTFS compression is not all-or-nothing. For example you can select which folders should be compressed. Just right click on the folder in Windows Explorer, select Properties, and on the General tab, click on Advanced. There you’ll see Compress contents to save disk space. Select that and the folder and optionally all folders within it will be compressed and all further files placed in those folders will be automatically and transparently compressed. Don’t do that to active folders, such as C:\Windows or c:\Windows\System32 for example, because it’ll adversely impact your performance. But if you have large collections of data that aren’t already compressed, and aren’t used that frequently, and your CPU won’t get in the way, it might be an option.
And in the long run, allowing your disk cleanup utility to compress old files likely won’t hurt. It probably just won’t get you a lot either.