Ignacio Soler Garcia
Ignacio Soler Garcia

Reputation: 21855

What means the "Using shared compilation with compiler from directory .." message and what's shared compilation?

Since the upgrade from VS2010 to VS2015 we see the following message on the compilation output that wasn't present before:

"using shared compilation with compiler from directory"

What does it mean and what is the Shared Compilation concept?

Googling for it I found almost nothing.

Upvotes: 8

Views: 5842

Answers (1)

Patrick Hofman
Patrick Hofman

Reputation: 157048

That is not very clear from documentation I read, but there is a clue in the source code documentation:

/// If this property is true then the task will take every C# or VB
/// compilation which is queued by MSBuild and send it to the
/// VBCSCompiler server instance, starting a new instance if necessary.
/// If false, we will use the values from ToolPath/Exe.

It seems that reusing the same service minimizes build time since the compiler can use past build intermediates and results, and compilation results from other related projects.

Some more clues from someone on the project (Jared Parsons, Microsoft):

What's happening is the MSBuild property UseSharedCompilation is being set to false. As such we are not using the compiler server and you're paying the JIT cost for CSC on every build. That is the reason for the slow down.

Upvotes: 12

Related Questions