Skip to content

Commit

Permalink
Tweaks
Browse files Browse the repository at this point in the history
Signed-off-by: Brentley Jones <github@brentleyjones.com>
  • Loading branch information
brentleyjones committed Mar 11, 2024
1 parent d862769 commit 77621ca
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions doc/common_info.md
Original file line number Diff line number Diff line change
Expand Up @@ -522,22 +522,25 @@ exec "$bazel_real" "$@"

In your main `.bazelrc` add `import xcode.bazelrc` at the very bottom.

## Optimizing remote build and cache performance
## Optimizing remote cache and build execution performance

When using Bazel's remote cache and/or build execution, there are a few flags you can pass to optimize performance.

One of these is [`modify_execution_info`](https://bazel.build/reference/command-line-reference#flag--modify_execution_info).
This flag allows adding or removing [mnemonics](https://bazel.build/reference/glossary#mnemonic) to configure what is cached or built remotely.
When using Bazel's remote cache and/or build execution, there are a few flags you can pass to optimize performance. One of those flags is [`--modify_execution_info`](https://bazel.build/reference/command-line-reference#flag--modify_execution_info), which allows adding or removing execution info for specific [mnemonics](https://bazel.build/reference/glossary#mnemonic), which in turn allows you to configure what is cached or built remotely.

We recommend adding the following to your `.bazelrc`:

```shell
common --modify_execution_info=^(BitcodeSymbolsCopy|BundleApp|BundleTreeApp|DsymDwarf|DsymLipo|GenerateAppleSymbolsFile|ObjcBinarySymbolStrip|CppLink|ObjcLink|ProcessAndSign|SignBinary|SwiftArchive|SwiftStdlibCopy)$=+no-remote,^(BundleResources|ImportedDynamicFrameworkProcessor)$=+no-remote-exec
common --modify_execution_info=^(BitcodeSymbolsCopy|BundleApp|BundleTreeApp|DsymDwarf|DsymLipo|GenerateAppleSymbolsFile|ObjcBinarySymbolStrip|CppArchive|CppLink|ObjcLink|ProcessAndSign|SignBinary|SwiftArchive|SwiftStdlibCopy)$=+no-remote,^(BundleResources|ImportedDynamicFrameworkProcessor)$=+no-remote-exec
```

The following table provides a rationale for each mnemonic. In general though, the mnemonics that are excluded in `modify_execution_info` are excluded because they are large outputs which change frequently and as such are faster when run locally, or they are not generally configured for remote execution (such as signing).

| Mnemonic | Rationale |
| --- | --- |
|ProcessAndSign | A signing action, RBE is not generally configured for signing. |
|SignBinary | A signing action, RBE is not generally configured for signing. |
The following table provides a rationale for each mnemonic and tag. In general though, the mnemonics that are excluded in `--modify_execution_info` are excluded because they produce or work on large outputs which change frequently and as such are faster when run locally, or they are not generally configured for remote execution (such as signing).

| Tag | Mnemonics | Rationale |
| --- | --- | --- |
| `no-remote` | `BundleApp`, `BundleTreeApp`, `ProcessAndSign` | Produces a large bundle, which is inefficient to upload and download |
| `no-remote` | `CppArchive`, `CppLink`, `ObjcLink`, `SwiftArchive` | Linked binaries have local paths, and it's slower to download them versus linking locally |
| `no-remote` | `SwiftStdlibCopy` | Processing Swift stdlib is a quick file copy of a locally available resource, so it's not worth uploading or downloading |
| `no-remote-exec`| `BitcodeSymbolsCopy`, `DsymDwarf`, `DsymLipo`, `GenerateAppleSymbolsFile` | Processing dSYMs/Symbols remotely requires uploading the linked binary; this could go away if you switch to uploading linked binaries |
| `no-remote-exec`| `ImportedDynamicFrameworkProcessor` | Processing dynamic frameworks remotely incurs an upload and download of the same blob |
| `no-remote-exec`| `ObjcBinarySymbolStrip` | Stripping binaries remotely requires uploading the linked binary; this could go away if you switch to uploading linked binaries |
| `no-remote-exec`| `ProcessAndSign`, `SignBinary` | RBE is not generally configured for code signing |
| `no-remote-exec` | `BundleApp`, `BundleResources`, `BundleTreeApp`, `ImportedDynamicFrameworkProcessor`, `ProcessAndSign`, `SignBinary` | These actions are inefficient to do remotely, but in large numbers downloading can be efficient |

0 comments on commit 77621ca

Please sign in to comment.