Emitting Module takes 25x the time in XCode 15.1 beta

Further investigation seems to show this is actually a macro performance problem. The emit module step seems to wait until all of the macros in the project are expanded before actually starting its work, which then takes about 25s to complete, rather than 100s that's indicated in the build log. This is exacerbated by two long standing macro performance issues: a debug swift-syntax build and treating every macro invocation as a separate process launch. This is extremely slow, as it hugely overcommits the system's cores with these separate processes, especially on systems with security software that tries to inspect every file read and process launch. Command line builds which limit the build system's parallelism and leave cores for the macros and security software actually complete faster than Xcode's default.

Has there been any progress in reducing the impact of macros on build time?

11 Likes