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|
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.