Skip to content

Commit 2f798ec

Browse files
committed
Update PR #2097 description
1 parent d9fe51d commit 2f798ec

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

pull/2097

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
## Description of the issue
2+
3+
The Makefile builds all architectures sequentially within each platform target. On a multi-core machine, make amazon-cloudwatch-agent-linux took ~75s because amd64 and arm64 binaries were compiled one after the other.
4+
5+
## Description of changes
6+
7+
Split build targets by architecture so amd64 and arm64 compile in parallel, and enable automatic parallelization via MAKEFLAGS:
8+
9+
- Add NPROCS/MAKEFLAGS += -j$(NPROCS) for automatic parallelization based on available CPU cores
10+
- Split amazon-cloudwatch-agent-linux into linux-amd64 + linux-arm64 sub-targets
11+
- Split amazon-cloudwatch-agent-darwin into darwin-amd64 + darwin-arm64 sub-targets
12+
- Add explicit build dependencies to package-prepare-* targets to prevent race conditions when running make release with -j
13+
- Exclude build-profile* directories from check_secrets to prevent false positives
14+
15+
## Tests
16+
17+
Local benchmarks (32-core machine):
18+
19+
| Target | Before | After | Speedup |
20+
|--------|--------|-------|---------|
21+
| `amazon-cloudwatch-agent-linux` | 74.93s | 6.22s | 12x |
22+
| `make build` (all platforms) | ~90s | 6.44s | ~14x |
23+
24+
CI benchmarks (non-cached, vs run #1679 (https://github.com/aws/amazon-cloudwatch-agent/actions/runs/24719951360)):
25+
26+
| Job | Before | After | Speedup |
27+
|-----|--------|-------|---------|
28+
| BuildAndUpload / MakeBinary | 13m 45s | 3m 47s | 3.6x |
29+
| BuildAndUploadCN / MakeBinary | 15m 9s | 4m 9s | 3.6x |
30+
| BuildAndUploadITAR / MakeBinary | 13m 55s | 5m 23s | 2.6x |
31+
| MakeMacPkg | 11m 27s | 3m 38s | 3.2x |
32+
33+
All existing top-level targets (make build, make release, make amazon-cloudwatch-agent-linux, etc.) are preserved — backwards compatible.

0 commit comments

Comments
 (0)