{"author":"Viktor Szakats","author_email":"commit@vsz.me","author_time":1739058607,"commit_time":1739188451,"committer":"Viktor Szakats","committer_email":"commit@vsz.me","hash":"29e4eda631f46368c2adf833ba3065b1b46c2a7d","message":"GHA/windows: improve build perf with cmake unity batches\n\nDefault curl unity builds make a single unit for each target. It means\nall target sources are batched together and built in a single compiler\ninvocation. With multi-core CPUs this doesn't always result in the best\npossible performance. This patch enables smaller batches for jobs where\nthis resulted in shorter build times. These jobs are Cygwin, MSYS2,\nMinGW, running on the Windows runners.\n\nUse batch of 30 (meaning 30 sources batched into units), and 32 for\nCygwin/MSYS2 to avoid a unity fallout that's subject to a different PR.\n\n(CMake allows to set the number of sources per unit, not the number\nof units, though the latter may be more practical to max out CPU cores.)\n\nAlso override to not batch the `curlu` target because batching lost\na little bit of time there, due to the already existing parallelism when\nbuilding the `testdeps` targets.\n\nFor jobs on the macOS and Linux runners jobs were already mostly single\ndigit or below teen seconds, and batching didn't improve on them\nnoticeably. On VM jobs, the virtual CPUs are limited, so I didn't\nmake a try. In AppVeyor and GHA vcpkg jobs (using msbuild), batching\ndidn't result in conclusive or any gains.\n\nBuild times in seconds (curl + testdeps):\nJob                  |          Before | After w curlu=0 | Gain\n:--------------------| :-------------- | :-------------- | :---\ncygwin, CM           |   19 + 32 =  51 |  12 +  32 =  44 |    7\nmsys2, CM            |    7 + 15 =  22 |   5 +  14 =  19 |    3\nmingw gcc U, CM      |   19 + 30 =  49 |  13 +  32 =  45 |    4\nmingw ucrt, CM       |   32 + 42 =  74 |  15 +  43 =  58 |   16\nmingw clang, CM      |   15 + 21 =  36 |   8 +  21 =  29 |    7\nmingw uwp, CM        |   30 + 40 =  70 |  14 +  40 =  54 |   16\nmingw gcc, CM        |   20 + 31 =  51 |  12 +  31 =  43 |    8\nmingw x86, CM        |   35 + 40 =  75 |  15 +  38 =  53 |   22\ndl-mingw, CM 9.5.0   |   88 + 99 = 187 |  42 + 101 = 143 |   44\ndl-mingw, CM 7.3.0 U |   24 + 32 =  56 |  17 +  35 =  52 |    4\nTotal                |                 |                 |  131\n\nTotal gain per GHA/windows workflow runs: 2m11s\n\nRuns:\nBefore: https://github.com/curl/curl/actions/runs/13220256084/job/36904342259\nAfter: https://github.com/curl/curl/actions/runs/13220383702/job/36904602981\n       https://github.com/curl/curl/actions/runs/13220613141/job/36905170104\n       https://github.com/curl/curl/actions/runs/13222019443/job/36908358550\nWith curlu tweak: https://github.com/curl/curl/actions/runs/13222239255/job/36908782462\n\nRef: 116950a25066257f86461f9d1dfa5f787f55e73c #16265\n\nCloses #16272\n","parents":["48df83a30e7d032ae3354d4b06e758ceb4210775"],"tree_hash":"d573a7c067cbcd91ccec6cab243fe60f2b4284cd"}