|
|
|
|
|
Build Time
Ed Grochowski
Written 4-3-2026
One metric that I regularly track is the build time of my programs which
are written in C++ and compiled by gcc. Over the past decade, the build
time has varied from 20 seconds to 2.5 minutes on an 8-core CPU with all
files cached in memory.
The following table explains the reasons for the variation.
| More Code
| The code has been steadily growing due to new functionality,
resulting in an upward trend over time.
|
| Build System
| The big drop between 2021 and 2022 was due to migrating from
Autotools to Meson and Ninja. In addition to making the build scripts
easier to write, Meson and Ninja cut the build time by two-thirds.
|
| C++ Templates and Inline Functions
| In 2023, I applied templates and inline functions to factor out
redundant code and speed up execution. Placing library code in headers
led to longer compilation.
|
| Multi-Architecture Support
| Not shown on the graph are the effects of migrating from
locally-compiled binaries to compiling both x86-64-v2 and x86-64-v3
binaries in the same build. This change took place in 2024 and doubled
the build time.
|
| Test Suites
| The big increase between 2024 and 2025 was due to incorporating the
shorter-running test suites into the build process to provide automatic
confirmation that the newly built programs work.
|
| Documentation
| In 2025, I made the generation of printable PDF documentation from
the HTML a part of the build process. This was previously a separate
step.
|
The main motivations have been to make the build more easily
maintainable and robust, and the execution times slightly faster. 2.5
minutes for a full build is a minor inconvenience, but by historical
standards, it is nowhere near the one hour that the Genius 2 computer once
took to rebuild its software.
|
|