Compiler cache for MS Visual C++ 6.0
Caching compiler output is basically a simple and old idea already imlemented in ccache to speed up compile times. In short you run the preprocessor first using the -E compiler switch then using this output and the complier switches paired with current source files you make a hash using for example md5sum. After this you need to run the full compiler and place all output produced in a database indexed by md5 hash previously computed. Whenever other preprocessing results in the same md5 hash you do not need to run the full compiler again as you can simply retrieve all output and object files previously stored. Of course as all this is done transparently, by a tool probably administrating a shared database between multiple developers, you will only notice the faster build without the additional complications.
We tried to do the same thing with the compiler used on some projects at my employer to make an improvements on build times; it did not succeed. Reason was that with the specific version of Microsoft compiler all this did not apply, running with -E switch consumes roughly the same time as without it. When I think about it that is strange since the hairy and difficult to parse C++ syntax, with templates and all the like just don’t exist at preprocessor stage!
Only reasonable explanation that I could come up is that -E switch was added latter as feature with less value for customer and therefore was probably implemented by simply dumping some internal data at whatever point in the compiler where the responsible programmer deemed to be less trouble to retro fit. After all it does produce the right output, only that probably after more processing that is would actually need.
