Skip to content
Feasibility study of building C++ modules in batch mode
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
COPYING Created the basic repository. Aug 9, 2019 Variable renaming. Aug 9, 2019 Added readme. Aug 9, 2019

Batch compiler for C++ modules feasibility study

A simple Python script that implements the core of this blog post. This only works with Visual Studio currently, as it ships the most complete module implementation as of today.

Using it is just a matter of running the script:


This script will fail if you run a localised version of Visual Studio. It requires all error messages to be in English.

All object files should get created in the correct order without needing to scan the contents of files.


  • This implementation launches two processes (about) per source file. In a real implementatio the compilation processes would not exit but instead would suspend until other compilation processes would finish building modules. This causes a 2x slowdown for this script compared to a proper implementation.

  • The script uses only one thread for simplicity. A real implementation could spawn multiple compilation threads or processes.

  • This script does not do incremental builds. The source code is marked with the location where that check would be needed. This approach requires, at the least, modifying the compiler so that it can read .d dependency files.

  • This implementation determines the missing modules by reading the compiler's output. In a full implementation there would be some different communication mechanism between the work launcher and worker threads. But it would be an implementation detail of the compiler and would not be exposed to anyone else.

You can’t perform that action at this time.