wixtoolset / issues

WiX Toolset Issues Tracker
http://wixtoolset.org/
129 stars 36 forks source link

Parallelize UpdateFileFacadesCommand #8208

Open MBroholmA opened 5 months ago

MBroholmA commented 5 months ago

User story

As a setup developer, I am able to build MSI packages with a large file count faster

Proposal

The proposal is to make UpdateFileFacadesCommand multi-threaded.

The motivation is a project consisting of ~30.000 files across ~100 instance transforms resulting in a .msi file size around 60MB.

The WiX build time of this project was around 1 hour. Almost all the time is spent in UpdateFileFacadesCommand (the files are distributed across multiple .cab files to parallelize the "wixnative.exe part" of the build).

The time in UpdateFileFacadesCommand is mostly spent waiting for the anti-virus software to scan each file as they are opened, which was visible in Procmon.exe and 1 busy CPU - the rest of them idle.

I made a custom version of WiX with a version of UpdateFileFacadesCommand with a Parallel.ForEach loop. This resulted in a build time of around 9 minutes on a 12-core machine.

I'd be happy to contribute this change.

Considerations

I checked that IMessage.Write is thread safe and as far as I could track the code paths there shouldn't be an issue.

barnson commented 5 months ago

Probably won't hurt :) so we'd definitely review a PR if you want to send one.

MBroholmA commented 5 months ago

I've created https://github.com/wixtoolset/wix/pull/525 but I don't know how to link it to this issue