Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I get Windows to go as fast as Linux for compiling C++?
    primarykey
    data
    text
    <p>I know this is not so much a programming question but it is relevant.</p> <p>I work on a fairly <a href="http://chromium.org" rel="nofollow noreferrer">large cross platform project</a>. On Windows I use VC++ 2008. On Linux I use gcc. There are around 40k files in the project. Windows is 10x to 40x slower than Linux at compiling and linking the same project. How can I fix that?</p> <p>A single change incremental build 20 seconds on Linux and > 3 mins on Windows. Why? I can even install the 'gold' linker in Linux and get that time down to 7 seconds.</p> <p>Similarly git is 10x to 40x faster on Linux than Windows. </p> <p>In the git case it's possible git is not using Windows in the optimal way but VC++? You'd think Microsoft would want to make their own developers as productive as possible and faster compilation would go a long way toward that. Maybe they are trying to encourage developers into C#?</p> <p>As simple test, find a folder with lots of subfolders and do a simple</p> <pre><code>dir /s &gt; c:\list.txt </code></pre> <p>on Windows. Do it twice and time the second run so it runs from the cache. Copy the files to Linux and do the equivalent 2 runs and time the second run.</p> <pre><code>ls -R &gt; /tmp/list.txt </code></pre> <p>I have 2 workstations with the exact same specs. HP Z600s with 12gig of ram, 8 cores at 3.0ghz. On a folder with ~400k files Windows takes 40seconds, Linux takes &lt; 1 second.</p> <p>Is there a registry setting I can set to speed up Windows? What gives?</p> <hr> <p>A few slightly relevant links, relevant to compile times, not necessarily i/o.</p> <ul> <li><p>Apparently <a href="https://randomascii.wordpress.com/2017/07/09/24-core-cpu-and-i-cant-move-my-mouse/" rel="nofollow noreferrer">there's an issue in Windows 10 (not in Windows 7) that closing a process holds a global lock</a>. When compiling with multiple cores and therefore multiple processes this issue hits.</p></li> <li><p><a href="https://randomascii.wordpress.com/2014/03/31/you-got-your-web-browser-in-my-compiler/" rel="nofollow noreferrer">The <code>/analyse</code> option can adversely affect perf because it loads a web browser</a>. (Not relevant here but good to know)</p></li> </ul>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload