Home

Awesome

Compactor

A friendly user interface to Windows 10 filesystem compression

With modern lightweight compression algorithms running at gigabytes per second per core, it's practically a no-brainer to apply them to filesystems to make better use of storage and IO.

Half-recognising this, Windows 10 ships with a reworked compression system that, while fast and effective, is only exposed to users via a command-line tool — compact.exe.

Compactor is here to plug that gap, with a simple GUI utility anyone can use.

Installation v0.10.1 Downloads

Downloads are available from the Github Releases page under Assets, or you can use these direct links:

The 64-bit version is recommended for most users.

If you get "Windows protected your PC" trying to run it, it's just SmartScreen upset the binaries aren't (yet) signed. Click "More info" and "Run anyway" if you judge things to be above-board.

Note this is beta software and comes with no warranty.

Features

Real-time Progress Updates

Compactor's directory analysis updates as it goes. You too can experience the satisfaction of watching the disk-space used counter tick down with each file compressed.

Pause, Resume, Stop

All operations can be paused and interrupted safely at any time. Compactor will finish off what it's doing and stop, or restart where it left off.

Compresstimation

Compactor performs a statistical compressibility check on larger files before passing them off to Windows for compaction. A large incompressible file can be skipped in less than a second instead of tying up your disk for minutes for zero benefit.

Machine Learning

Using advanced condition-based AI logic, Compactor can skip over files that have been previously found to be incompressible, making re-running Compactor on a previously compressed folder much quicker.

(Yes, it's an if statement and a trivial hash database, hush)

Scalable and Fast

Written in Rust, a modern compiled systems programming language from Mozilla, Compactor can cope easily with large folders containing millions of files.

Caveats

Beta Software

While it has been used successfully by thousands of people, Compactor should be used with care. It is intended for compressing replacable software, not precious files.

Make backups. Report bugs. Be nice. You are reminded:

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

It's in shouty legal text so you know I mean it.

Data Corruption

There has been one report of data corruption with open SQLite database files. The author has been unable to reproduce this, but file locking was added to version 0.10 which should prevent them from being modified.

Permissions

Compactor currently has no mechanism to elevate its privileges using UAC for protected files. If you're using a limited account you may need to run the program with elevated permissions.

Be careful what you compress. System files should be skipped automatically, and the Windows folder should be in the list of default exclusions (if you want to compact Windows, check out its CompactOS feature), but you almost certainly don't want to blindly run this across your entire C:\ drive.

Modifiable Files

Compaction is designed for files that rarely change — any modifications result in the file being uncompressed in its entirety. In fact, simply opening a file in write mode will hang until the file is uncompressed, even if no changes are made.

This generally doesn't matter much for application folders, but it's not great for databases, logs, virtual machine images, and various other things that hopefully mostly live elsewhere.

If a game uses large files and in-place binary patching for updates, it might be worth adding to the exclusions list.

Compatibility with Other Operating Systems

Compaction is only supported on Windows 10 - earlier versions of Windows will be unable to access compressed files, though the rest of the filesystem should remain fully accessible.

Linux and other operating systems will experience similar issues if the NTFS driver they're using lacks support. As of time of writing, NTFS-3G has a third-party plugin for the feature.

This is available on FreeBSD under sysutils/fusefs-ntfs-compression, while users of lesser platforms may need to manually install it like savages.

Compression Results

A totally-not-cherry-picked sample of compression results with the default settings:

ProgramSizeCompactedRatio
AI War 22.43 GiB1.42 GiB0.59x
Big Pharma1.1 GiB711 MiB0.37x
Crusader Kings 22.19 GiB1.29 GiB0.59x
Deus Ex MD41.31 GiB28.06 GiB0.68x
Infinifactory1.71 GiB742 MiB0.58x
Satisfactory15.82 GiB10.45 GiB0.66x
Space Engineers16.28 GiB9.4 GiB0.58x
Stellaris7.76 GiB5.21 GiB0.67x
Subnautica BZ10.62 GiB6.40 GiB0.60x
The Long Dark7.42 GiB5.64 GiB0.76x
Microsoft SDKs5.91 GiB2.45 GiB0.41x
Visual Studio 20179.63 GiB4.77 GiB0.50x
Windows Kits5.38 GiB2.03 GiB0.38x

A more comprehensive database of results is maintained by the CompactGUI project.

Future

There are many things I want to do with Compactor in future. These include, but are certainly not limited to:

Feature requests can be discussed in the forum, or you may open an issue.

Alternatives

Are you aware of any others? Do let me know.

Nerdy Technical Stuff

Compactor is primarily written in Rust. The front-end is basically an embedded website driven by the web-view crate. It does not depend on any remote resources or open any ports.

Under the hood it uses DeviceIoControl with FSCTL_SET_EXTERNAL_BACKING and FSCTL_DELETE_EXTERNAL_BACKING, and a few functions from WofApi (Windows Overlay Filesystem). This is, of course, in part thanks to the winapi crate. Eventually I hope to get around to finishing off some of my bindings and contributing them back.

Compresstimation uses a simple linear sampling algorithm, passing blocks through LZ4 level 1 as a compressibility check and averaging across the entire file. The code is available on Github.

The incompressible-files database is simply an append-only list of SipHash128 path hashes. It should be safe to share between multiple instances if you want to compress different drives at the same time. It lives in %APPDATA%\Local\Freaky\Compactor.

Author

Compactor is written by Thomas Hurst, a nerdy, aloof weirdo from the north-east of England, and a programmer for about 25 years.

He mostly works with FreeBSD and focuses on Unix platforms, but uses Windows because he plays games instead of having a social life.

You can find him on Mastodon at @Freaky@hachyderm.io, or bug him on IRC as Freaky on libera.chat.