Skip to Content

A wix-devs hint: Speed up setup builds

I set up a new workstation this weekend and wanted to see how well the multi-process WiX build took advantage of the many cores I paid for. The good news is that the source-code build is about twice as fast – not bad for three times the number of cores. There’s still room for improvement, but so far, nobody’s done a “deep dive” to add the discrete project references and other synchronization needed to get maximum parallelization.

The bad news is that building the WiX bundle takes two thirds of the entire build time: 44 seconds out of 65. Two primary reasons for that:

  • MSBuild can build multiple .wixproj projects in parallel but within each build, only when building multiple cabinets are multiple CPUs used. When you build an all-in-one compressed bundle, a single cabinet is built as the attached container.
  • The WiX build defaults to high cabinet compression. High compression squeezes the last bit of compression – at least what passes for compression for cabinets – at a high CPU cost.

The first bullet doesn’t have a quick or easy fix. For example, if we replaced the bundle container format with LZMA, we could get multi-threaded compression but we can’t do much about the fact that MSI requires cabinets.

On the second bullet, there’s a fix that’s both quick and easy. In fact, I already blogged about it, three years ago. After remembering that, my alias to build WiX now sets the WIX_COMPRESSION_LEVEL environment variable to none before invoking MSBuild. Setup build time after that change went down to 19 seconds.

Now, to see what RAID-0 does…