
Joseph Sibony
reading time:
It may seem counterintuitive, but sometimes not running something can help you be faster. It’s a guiding principle for how web browsers work. Instead of loading every asset on a page, cached elements are already there – no need to re-load them each time you visit a website or webpage. Your page loads faster, the browser does less work, and the end result is the same.
This is the same rule guiding caching in software development. In this case, caching offers several key benefits:
Caching can happen on several levels, with different degrees of impact on your performance. The more granular the caching is (e.g., caching an entire section of a code base vs a few lines vs a script), the better your performance and the more costs are reduced.
Therefore, when you think about caching build artifacts, it’s great to be able to cache and reuse final artifacts like executables and libraries, but you should think smaller. Your cache should also include intermediate artifacts – C++ obj files, debug information, and other aspects of your build including unit test outputs and custom build commands.
One of the driving principles of caching is that to successfully reuse a cached artifact during compilation, the current task must have the exact relevant input dependencies as a previously cached output artifact.
To achieve this, each task that places an artifact in the cache must associate all the input dependencies that led to the creation of the cached artifact. This is usually done by creating a unique hash ID that represents all the task dependencies, including input files, environment variables, command line parameters and other inputs. This Hash ID will represent all the dependencies that lead to a specific artifact.
Any tasks that are executed will be able to reuse previously cached artifacts only if all its relevant input dependencies are identical to a hash that represents a previously executed task.
Common approaches to this requirement create a burden on the user and the tool/compiler we are looking to cache:
Incredibuild’s unique approach to build cache is based on the foundation of the platform’s robust, field-proven parallel distribution technology – low-level system-hooks that are injected into processes, similar to how anti-virus software works. This allows incredibuild to automatically map out every file read, or other inputs accessed by a process, making it seamless and generic to determine task dependencies and lifting the burden off both the user and the tool.
Here’s how it works:
Using system hooks to seamlessly track process dependencies for caching purposes is an entirely new approach to caching (the U.S. Patent Office recognized this approach as technologically innovative enough to deserve a patent).
Let’s use an example from Visual Studio C++ to show how Incredibuild works. As one of the most best C++ IDEs, Visual Studio benefits from caching at multiple levels: a ‘solution level,’ a ‘project level,’ and a ‘unit (file) level.
This means that if nothing has changed in a project, the entire project’s artifact can be re-used without rebuilding any of its units (In a large C++ application there are typically hundreds of units within many projects within a solution). Having more granular unit-level caching (in C++ it means caching each compiled unit’s “obj” file) means that even if the final artifact’s dependencies have changed due to a change in a single unit, only the unit that has changed will need to be re-executed, while the rest of the unit’s outputs can be retrieved from the cache, resulting in much faster build time with less compute power.
This unique approach to generic, “behind-the-scenes” caching unlocks additional capabilities for the future of the dev ecosystem. The field is highly fragmented with many tools being used as part of large build execution – various compilers, build systems, software language tools, test frameworks and more. This fragmentation often extends into testing processes, including unit tests, integration tests, and end-to-end testing, all of which can benefit from improved caching solutions.
Incredibuild’s generic approach to caching will allow us to offer a single holistic caching solution for all the tools being used as part of a build that can benefit from caching services. This also lets our customers accelerate:
Having a holistic solution to caching that can benefit many different use cases means that every feature being developed around the caching services will serve all the caching use cases. This approach opens a lot of use cases and justifies the large investment we envision for such a holistic, robust cache.
You can learn more about Incredibuild’s Build Cache here.
Table of Contents
Shorten your builds
Incredibuild empowers your teams to be productive and focus on innovating.
Incredibuild empowers your teams to be productive and focus on innovating.
| Cookie | Duration | Description |
|---|---|---|
| cookielawinfo-checkbox-analytics | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics". |
| cookielawinfo-checkbox-functional | 11 months | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". |
| cookielawinfo-checkbox-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
| cookielawinfo-checkbox-others | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. |
| cookielawinfo-checkbox-performance | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance". |
| viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |