Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Windows] Improve build performance on windows #17671

Merged
merged 2 commits into from Apr 16, 2020
Merged

Conversation

Paxxi
Copy link
Member

@Paxxi Paxxi commented Apr 13, 2020

Description

Using C++ Build Insights in VS2019 I recorded a build
and looked at time spent parsing header files. This PR
adds some of the slow headers to pch.

Rough numbers on before after on my machine
Debug:

  • Before: 00:11:35
  • After: 00:07:58

RelWithDebInfo

  • Before: 00:21:48
  • After: 00:17:15

measured using
msbuild kodi.sln -t:Clean -P:Configuration=RelWithDebInfo
msbuild kodi.sln -t:Build -P:Configuration=RelWithDebInfo

Included Path Count Exclusive Duration (s)
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\zmmintrin.h 977 107,579000000
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\ppltasks.h 507 97,202000000
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\chrono 943 72,215000000
C:\code\kodi\project\BuildDependencies\x64\include\fmt\format.h 947 58,281000000
C:\code\kodi\xbmc\FileItem.h 562 50,436000000
C:\code\kodi\xbmc\addons\addoninfo\AddonInfo.h 609 47,643000000
C:\code\kodi\project\BuildDependencies\x64\include\fmt\core.h 947 35,932000000
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\algorithm 1064 32,647000000
C:\code\kodi\xbmc\windowing\GraphicContext.h 450 25,386000000
C:\code\kodi\xbmc\addons\addoninfo\AddonExtensions.h 610 23,582000000
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\DirectXMathVector.inl 58 22,396000000
C:\code\kodi\xbmc\guilib\GUIWindow.h 329 21,691000000
C:\code\kodi\xbmc\utils\Variant.h 624 20,434000000
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\mutex 936 19,288000000
C:\code\kodi\xbmc\settings\lib\Setting.h 176 18,965000000
C:\code\kodi\xbmc\guilib\GUIWindowManager.h 247 18,292000000
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\atomic 633 17,678000000
C:\code\kodi\xbmc\windowing\WinSystem.h 459 17,489000000
C:\code\kodi\project\BuildDependencies\x64\include\tinyxml.h 449 15,892000000
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\functional 569 15,486000000
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\future 485 14,856000000
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\list 787 14,314000000
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\intrin.h 977 14,184000000
C:\code\kodi\xbmc\ServiceManager.h 130 14,184000000

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of change

  • Bug fix (non-breaking change which fixes an issue)
  • Clean up (non-breaking change which removes non-working, unmaintained functionality)
  • Improvement (non-breaking change which improves existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that will cause existing functionality to change)
  • Cosmetic change (non-breaking change that doesn't touch code)
  • None of the above (please explain below)

Checklist:

  • My code follows the Code Guidelines of this project
  • My change requires a change to the documentation, either Doxygen or wiki
  • I have updated the documentation accordingly
  • I have read the Contributing document
  • I have added tests to cover my change
  • All new and existing tests passed

Using C++ Build Insights in VS2019 I recorded a build
and looked at time spent parsing header files. This PR
adds some of the slow headers to pch.

Rough numbers on before after on my machine
Debug:
  - Before: 00:11:35
  - After: 00:07:58

 RelWithDebInfo
   - Before: 00:21:48
   - After: 00:17:15

 measured using
 msbuild kodi.sln -t:Clean -P:Configuration=RelWithDebInfo
 msbuild kodi.sln -t:Build -P:Configuration=RelWithDebInfo
@Paxxi Paxxi added Platform: Windows Platform: WindowsStore Type: Improvement non-breaking change which improves existing functionality v19 Matrix labels Apr 13, 2020
@Paxxi Paxxi added this to the Matrix 19.0-alpha 1 milestone Apr 13, 2020
@neo1973
Copy link
Member

neo1973 commented Apr 13, 2020

Just something to keep in mind for the future, native support for precompiled headers was added to CMake in 3.16: https://cmake.org/cmake/help/latest/command/target_precompile_headers.html
Once the minimum required CMake version is raised it would probably be beneficial to switch to that method to speed up compilation on all platforms.

@lrusak
Copy link
Contributor

lrusak commented Apr 13, 2020

@garbear
Copy link
Member

garbear commented Apr 14, 2020

The amount of coffee I don't drink waiting for kodi to compile is coming out of your paycheck. Nice timing stats.

@garbear
Copy link
Member

garbear commented Apr 14, 2020

When the clang commit comes first, git blame is more beautiful with relevant commit messages appearing instead of clang format lemons. For next time.

@Paxxi Paxxi merged commit 2b670a8 into xbmc:master Apr 16, 2020
Maven85 pushed a commit to Maven85/kodi that referenced this pull request Apr 17, 2020
[Windows] Improve build performance on windows
Maven85 pushed a commit to Maven85/kodi that referenced this pull request Apr 17, 2020
[Windows] Improve build performance on windows
Maven85 pushed a commit to Maven85/kodi that referenced this pull request May 5, 2020
[Windows] Improve build performance on windows
Maven85 pushed a commit to Maven85/kodi that referenced this pull request Aug 3, 2020
[Windows] Improve build performance on windows
Maven85 pushed a commit to Maven85/kodi that referenced this pull request Aug 4, 2020
[Windows] Improve build performance on windows
Maven85 pushed a commit to Maven85/kodi that referenced this pull request Aug 4, 2020
[Windows] Improve build performance on windows
Maven85 pushed a commit to Maven85/kodi that referenced this pull request Aug 5, 2020
[Windows] Improve build performance on windows
Maven85 pushed a commit to Maven85/kodi that referenced this pull request Aug 6, 2020
[Windows] Improve build performance on windows
Maven85 pushed a commit to Maven85/kodi that referenced this pull request Aug 6, 2020
[Windows] Improve build performance on windows
Maven85 pushed a commit to Maven85/kodi that referenced this pull request Aug 6, 2020
[Windows] Improve build performance on windows
Maven85 pushed a commit to Maven85/kodi that referenced this pull request Aug 7, 2020
[Windows] Improve build performance on windows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: Windows Platform: WindowsStore Type: Improvement non-breaking change which improves existing functionality v19 Matrix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants