KBEA-00131 - Using the dependency optimization feature

Article ID:360032824932
2 minute readKnowledge base

This KB article is applicable to ElectricAccelerator v7.0 and later.


ElectricAccelerator includes a dependency optimization feature to improve performance. By learning which dependencies are actually needed for a build, Accelerator can use that information to improve performance in subsequent builds.

When dependency optimization is enabled, emake maintains a dependency information file for each makefile. If a build’s dependencies have not changed from its previous build, emake can use that stored dependency information file for subsequent builds.

Enabling dependency optimization

You must first run a "learning" build with the dependency optimization feature enabled. To enable dependency optimization, set the following: --emake`-optimize-deps=1`

For the learning build, (because there is no stored dependency information file for that specific makefile), the argument only saves a new result. For subsequent builds, the argument enables the reuse of stored dependency information and saves a new file as appropriate. If you do not specify --emake-optimize-deps=1, then dependency information is not saved or accessed.

It is recommended that you turn on --emake-autodepend=1 to ensure accurate incremental builds.

The following table describes dependency optimization-related options.

|== | eMake Option | Description

| --emake-assetdir=<`path>` | Use the specified directory for assets such as saved dependency information. The default directory is .emake. This option also affects parse avoidance.

| --emake-optimize-deps=<`0/1>` | Use the saved dependency information file for a makefile when dependencies are the same and save new dependency information when appropriate. |==

Dependency optimization file location and naming

Dependency information files are saved in the working directory where emake was invoked under <`assetdir>/deps`. (The default asset directory is .emake.)

The file is named from the md5 hash of the root-relative path of the "main" makefile for the make instance that the dependency information file belongs to.


  • If your emake root is /tmp/src, and your makefile is /tmp/src/Makefile, then the dependency information file is named after the md5 hash of the string "Makefile".

  • If your root is /tmp/src and your makefile is /tmp/src/foo/Makefile, the file is named after the md5 hash of the string "foo/Makefile".


  • Dependency optimization is not supported when using NMAKE (or Visual Studio/devenv) emulation.

Applies to

  • Product versions: 7.0 and later