I Gotta Stop Following Advice From Reddit
Linus Tech Tips
779,535 views • yesterday Save 8 min 4 min read
Video Summary
A Redditor's attempt to free up space by compressing their Windows folder with WinRAR backfired spectacularly, highlighting a common misconception about data compression. While WinRAR allowed the user to archive and delete system files, the action resulted in significant system instability, proving that not all compression is created equal.
The video delves into the history and mechanics of data compression, explaining how early storage limitations necessitated solutions like file archiving and algorithmic compression. It traces the evolution from simple LZ-based methods to modern lossless and lossy compression techniques used in everything from operating systems to multimedia. Ultimately, the explanation reveals that while modern operating systems like Windows 10 and 11 include tools like CompactOS for system file compression, these are not enabled by default because the gains are minimal compared to the potential risks and the decreasing cost of storage.
Short Highlights
- Attempting to compress Windows system files using WinRAR can lead to system instability and data loss.
- Data compression works by identifying and reducing redundancy in files.
- Early storage limitations drove the development of compression techniques.
- Lossless compression creates perfect copies, while lossy compression discards unnoticeable data.
- Modern operating systems have built-in compression tools like CompactOS.
- The benefits of compressing system files are often outweighed by the risks and minimal gains.
Key Details
The Redditor's Mistake [00:00:00]
- A user attempted to free up disk space by using WinRAR to compress their entire Windows folder.
- WinRAR allowed the compression of system files, even those in use, and offered an option to delete the originals.
- This action led to system instability, demonstrating that not all compression methods are suitable for operating system files.
WinRAR will absolutely let you do this.
The Concept of Compression [00:01:09]
- Data is stored in sectors, the smallest writable unit on a disk, leading to wasted space if files don't fill a sector completely.
- Early hard drives had very limited capacity, making even small amounts of wasted space significant.
- Compression aims to reduce file size by eliminating redundancy or representing data more efficiently.
So, how about taking those small inefficient files and bundling them together into a larger container file that squeezes out the extra zeros?
Algorithmic Compression [00:02:18]
- Compression algorithms look for repetitions in data, replacing repeated sequences with shorter markers (e.g., '12 red' instead of 'red red red...').
- Algorithms based on Lempel-Ziv (LZ) became foundational for many compression schemes.
- Early compression saved significant amounts of expensive storage space, as seen with shareware shrinking from 160 KB to 95 KB.
A basic idea could be to look for repetitions in your data structure.
Full Disk Compression [00:03:55]
- Companies like Stack developed software (e.g., Stacker) that compressed files and wrapped them in virtual disk containers.
- This effectively doubled hard drive capacity and could even speed up file access on slow drives.
- Full disk compression became a standard feature in DOS and early Windows versions, though it sometimes caused drive failures.
Needless to say, that idea took off.
Modern Compression and CompactOS [00:05:35]
- Compression is now often built into file systems, and Windows includes CompactOS to compress OS files.
- CompactOS is not enabled by default because the gains are minimal compared to modern storage capacity and cost.
- Modern file formats (like .docx) are often compressed internally, and web content heavily relies on compression.
But, hold on a second. Why isn't CompactOS enabled by default?
Lossless vs. Lossy Compression [00:07:05]
- Lossless compression creates an exact, reversible copy of the original data, crucial for game assets or software.
- Lossy compression discards data that is unlikely to be noticed, significantly reducing file size for multimedia like JPEGs, MP3s, and videos.
- Most modern media files are already compressed using lossy methods, meaning further compression yields little benefit.
If we need a one-to-one perfect copy of our source material, then we would use a lossless algorithm.