Unity Build Technique for C++ Application Compilation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current software development build cycles for large C++ projects are processor, memory, and hard drive intensive, leading to significantly reduced developer productivity due to long build times, which can delay time-to-market and increase defect counts.

Innovation Solution

Implementing a unity build technique that compiles all source files into a single or few object files by referencing all source files in a unity file, reducing disk reads and writes, and automating the generation of unity source files to streamline the build process.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If traditional compilation method is used for large C++ projects, then each source file is compiled separately into object files which are then linked, but this results in repeated reading and parsing of header files and long build times

Engineering Contradiction:
Improvebuild speedVSAvoidbuild time
Core Design Contradiction:
ProductivityVSLoss of time

Solution Approach 1:

The patent merges multiple source files into a single unity file that includes all source code. This unity file is then compiled once to produce a single object file, eliminating the need for separate compilation and linking of individual source files. The merging principle directly resolves the technical contradiction by consolidating the build process to avoid repeated header file parsing and multiple disk I/O operations.

Inventive Principle:
Principle #5Merging (Combining)

2Productivity

If build frequency is increased to improve productivity, then more unit testing can be performed, but build times become excessively long and consume excessive processor, memory and hard drive resources

Engineering Contradiction:
Improveunit testing frequencyVSAvoidprocessor, memory and hard drive usage
Core Design Contradiction:
ProductivityVSUse of energy by moving object

Solution Approach 1:

By merging all source files into a unity file and compiling them as a single unit, the patent dramatically reduces the computational resources required per build. The single compilation pass eliminates redundant header file parsing and reduces the number of object file generations, allowing developers to build more frequently without overloading system resources.

Inventive Principle:
Principle #5Merging (Combining)

3Ease of manufacture

If source files are compiled separately into multiple object files, then modular compilation is achieved, but this results in multiple disk reads and writes and extended link times

Engineering Contradiction:
Improvecompilation modularityVSAvoidnumber of build stages
Core Design Contradiction:
Ease of manufactureVSDevice complexity

Solution Approach 1:

The patent combines multiple compilation stages into a single compilation operation. Instead of compiling each source file separately and then linking object files, the unity file approach performs one compilation that produces a single object file ready for linking. This reduces the number of build stages and disk I/O operations while maintaining the ability to organize source code in a structured manner within the unity file.

Inventive Principle:
Principle #5Merging (Combining)

Data Source

PatentUS11768668B2Methods, apparatuses and computer program products for improving productivity for building applications
Publication Date: 2023.09.26 UNITED PARCEL SERVICE OF AMERICAN INC
  • US11768668B2 patent drawing
  • US11768668B2 patent drawing
  • US11768668B2 patent drawing

AI summary

An apparatus is provided for building an application. The apparatus may include at least one memory and at least one processor configured to generate a build of an application in a C Object-Oriented Programming Language. The processor is also configured to generate a unity file including a plurality of source files having references to one or more header files. At least two of the source files include references to a same header file. The processor is also configured to compile the unity file including the plurality of source files to obtain an object file. The processor is also configured to link the object file to generate an executable of the application. Corresponding computer program products and methods are also provided.