Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • CMake CMake
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,928
    • Issues 3,928
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 19
    • Merge requests 19
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CMake
  • CMakeCMake
  • Issues
  • #21703
Closed
Open
Created Jan 13, 2021 by Borislav Stanimirov@iboB

FetchContent has poor performance on Windows

Take this minimal example: https://github.com/iboB/cmake-fetch-content-perf/blob/master/CMakeLists.txt

On Ubuntu 20.04 (more precisely WSL) - CMake 3.16.3 - after the initial slow configure, each subsequent one takes about 200ms per fetch content item. This is not great (and I have a suggestion for improvement, which seems too much for now, in #21698 (closed)), but I guess I can live with 200ms per item.

On Windows - CMake 3.19.2 - however each item takes about 1.2 seconds (the exact same machine). I think this is too slow, and I can find no reason for the 5x slowdown. At first I thought it was because of FetchContent relies on ExternalProject_Add which in turn calls cmake --build and this launches the heavy machinery of MSBuild with my default generator. However I tried it with MinGW Makefiles and saw no difference in performance. Still about 1.2 seconds per item.

Summarized personal measurements from this and below posts:

OS CMake Ver Generator Machine ~ ms per item
Ubuntu 20.04 3.16.3 Unix Makefiles ThreadRipper, SSD 200
Windows 10 3.19.2 Visual Studio 2019 ThreadRipper, SSD 1200
Windows 10 3.19.2 MinGW Makefiles ThreadRipper, SSD 1200
Arch Linux 3.19.2 Unix Makefiles 8 core @ 2.4 GHz, HDD 800
Arch Linux 3.19.2 Unix Makefiles 8 core @ 2.4 GHz, RAM 700
Arch Linux 3.16.3 Unix Makefiles 8 core @ 2.4 GHz, HDD 350
Arch Linux 3.16.3 Unix Makefiles 8 core @ 2.4 GHz, RAM 300
Windows 10 3.16.3 MinGW Makefiles 6 core @ 3 GHz, SSD 1500
Edited Jan 15, 2021 by Borislav Stanimirov
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking