GCC’s –param lto-partitions= compiler flag is used for controlling the number of partitions used during Link Time Optimization (LTO). It had defaulted to 128 for a number of years but given today’s rising core counts especially for servers and HEDT/workstation processors, that default partition count is being quadrupled.
GNU Compiler Collection developer Jan Hubicka has raised the default LTO partition size for next year’s GCC 16 compiler release. Users can easily override the value via the –param lto-partitions= compiler flag but given today’s increasingly high core count systems, the default is shifting from 128 to 512.
Hubicka reasoned in the commit bumping the default size:
“Increase default number of LTO partitions
The number of LTO partitions should exceed number of CPUs (or hyper-threads) of commonly used CPUs. I think it is time to increase it again and as discussed in the LTO and toplevel asm thread, doing so scales quite well. Tmp file usage grows from 2.7 to 2.9MB which seems acceptable. Overall build time on machine with 256 hyperthreads is comparable.”
By increasing the default LTO partition count there will be greater parallelism in splitting the LTO process into smaller elements.
With the likes of the Threadripper 9995WX featuring 96 cores / 192 threads for workstations and the EPYC 9965 hitting 192 cores / 384 threads per socket, it was well past time for increasing the default number of LTO partitions since 128. We’ll see how long this 512 default value lasts with next-gen processors expected to push core counts even higher.