Visual Studio compiles 7 min 40 sec, command line compiles 1 min 56 sec.

rain 41 Reputation points
2022-05-12T20:26:41.853+00:00

Hi!

How can I make visual studio compile faster? It compiles the same project 7 min and 40 sec while command line compiles it 1 min and 56 sec.

Command line that I use:
msbuild openrct2.proj /t:build /p:platform=x64 /p:configuration=Debug

If I compile it from command line it uses 100% CPU all the time. If compile it from Visual Studio then it uses 100% CPU at the beginning and then it drops to 12%. I have 6 cores and 12 logical processors. What do I need to do to make Visual Studio also use 100% cpu like command line does?

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,787 questions
Not Monitored
Not Monitored
Tag not monitored by Microsoft.
40,310 questions
0 comments No comments
{count} votes

Accepted answer
  1. Anna Xiu-MSFT 30,116 Reputation points Microsoft Vendor
    2022-05-13T08:47:48.207+00:00

    Hi @rain ,

    Welcome to Microsoft Q&A!

    Which version of Visual Studio are you using?

    Please try to update your VS to the latest version and check if it is improved.

    Besides, many components and extensions installed in Visual Studio may increase loading time.
    You can disable the installed extensions that you do not use under Extensions > Manage Extensions > Installed.

    Meanwhile, please clear the Visual Studio components cache folder. It is located at %localappdata%\Microsoft\VisualStudio\1X.0_xxxx\ComponentModelCache.
    And delete the hidden .vs, bin and obj folders in the project folder.

    Sincerely,
    Anna
    *
    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


1 additional answer

Sort by: Most helpful
  1. rain 41 Reputation points
    2022-05-13T19:52:00.707+00:00

    I have VS 2022.

    Updating from 17.1.0 Preview 4.0 to 17.3.0 Preview 1.0 seem to have helped.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.