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

readme.md

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:

python batchtest.py

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.

Caveats

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