Skip to Content

Cabinet compression testing

Over in a WiX v4.0 pull request, Rob and I were discussing what the default compression level should be in WiX v4.0. In WiX v3.x, the default compression level is “mszip” which, listening to legend and lore, I always considered to provide decent compression and decent performance. Rob suggested using “high” compression level, which I’d always avoided except for nightly builds. Sometimes not even then since it’s known—again, legend and lore—to be extremely slow.

As I point out in the pull request, however, the only way to be sure is to measure it.

So that’s what I did.

In addition to measuring the performance and compression of each level, I wanted to measure the impact of multithreaded cabbing and adjusting the number of cabinets using MediaTemplate’s ability to automatically create cabinets.

Here are some of the interesting (to me, anyway) findings:

  • MSZip compression is pretty fast but doesn’t compress particularly well.
  • Throwing three times the number of cores at cabbing barely halved the typical build time.
  • Reducing the number of .cabs slowed the build but reduced the total size because of WiX smart-cabbing, which eliminates storage for identical files within a .cab.
  • Tuning the number of .cabs for a particular product can make a huge difference in build time. For example, in this test, going from two to three cabs almost halves the build time, given enough cores. That’s because with two .cabs, one is filled (to 200MB) leaving the second cab with ~75MB. With three .cabs, each is closer to the same size so there’s no “long pole” holding up the whole build.

So I decided my vote for the WiX v4.0 defaults:

  • Compression level: Low
  • MediaTeplate/@MaximumUncompressedMediaSize: 100MB

The following results are mine, on my workstation. I can’t guarantee identical results elsewhere. Your mileage will vary.

Compression level Cores MUMS Cab count Cab size Link time
None 12 5 64 275,534,590 00:08.44
None 12 25 12 274,523,496 00:08.01
None 4 5 64 275,534,590 00:09.08
None 4 25 12 274,523,496 00:08.94
None 4 100 3 265,374,476 00:12.08
None 4 200 2 256,813,376 00:17.75
None 4 500 1 232,013,031 00:37.41
MSZip 12 5 64 79,041,356 00:11.90
MSZip 12 25 12 78,751,377 00:12.32
MSZip 4 5 64 79,041,356 00:19.98
MSZip 4 25 12 78,751,377 00:21.04
MSZip 4 100 3 74,188,901 00:29.18
MSZip 4 200 2 70,880,347 00:52.98
MSZip 4 500 1 64,084,269 01:05.53
Low 12 5 64 70,895,708 00:14.56
Low 12 25 12 70,679,266 00:15.51
Low 4 5 64 70,895,708 00:27.74
Low 4 25 12 70,679,266 00:30.80
Low 4 100 3 66,323,496 00:43.85
Low 4 200 2 63,236,254 01:27.53
Low 4 500 1 57,326,092 01:44.48
Medium 12 5 64 66,050,456 00:16.78
Medium 12 25 12 66,064,972 00:17.89
Medium 4 5 64 66,050,456 00:33.14
Medium 4 25 12 66,064,972 00:38.05
Medium 4 100 3 62,185,278 00:53.67
Medium 4 200 2 59,333,058 01:46.71
Medium 4 500 1 53,921,524 02:08.74
High 12 5 64 59,153,870 00:20.37
High 12 25 12 59,852,538 00:21.32
High 4 5 64 59,153,870 00:39.76
High 4 25 12 59,852,538 00:42.95
High 4 100 3 57,586,830 00:57.99
High 4 200 2 55,301,764 01:54.78
High 4 500 1 50,818,728 02:19.23

I ran the tests—bare-metal—on a Lenovo ThinkStation D20 with two six-core Xeon X5650 CPUs (12M L3 cache, 2.66 GHz bursting to 3.06 GHz) and 24GB ECC RAM. Hyperthreading was disabled so multiple cabinets were each built on a “real” core. The hard drive was a one-terabyte Western Digital WD1002F9YZ with 128MB cache.

The payloads of the build are a WiX v3.9 debug build and source combined into one tree: 276,955,162 bytes across 6445 files in 713 directories.

Compression level was set via the WIX_COMPRESSION_LEVEL environment variable. MUMS (maximum uncompressed media size) was set via WIX_MUMS. Number of cores was set via light’s -ct switch.