ocaml / ocaml

The core OCaml system: compilers, runtime system, base libraries
https://ocaml.org
Other
5.19k stars 1.06k forks source link

gha: use all available cores when building MSVC #13131

Closed MisterDA closed 2 weeks ago

MisterDA commented 2 weeks ago

A comparison of the "Build OCaml" task, sequential versus parallel. According to the docs, runners have 4 CPUs. "cached" means that the configure script results have been cached. Considering these ad-hoc benchmarks of GitHub Actions on my fork, I'm going with the -j option of Make, which will not limit the number of jobs that can run simultaneously.

This is similar to what we already do in AppVeyor for MinGW-w64 builds, although we bound the number of simultaneous jobs with -j$NUMBER_OF_PROCESSORS (equivalent to -j$(nproc) on Linux).

sequential parallel, -j4 parallel, -j4, cached parallel, -j, cached
MSVC 64 bits 13m 26s 6m 21s 6m 19s 6m 5s
clang-cl 64 bits 14m 58s 8m 17s 7m 21s 7m 4s
MSVC 32 bits 8m 28s 4m 31s 4m 35s 3m 56s

This PR currently sits on my previous PR enabling the Autoconf cache. I'll rebase once it's merged.