Skip to content

Add MAKEFLAGS=-j$(nproc) to test and build-layer jobs#2274

Closed
yoshi-taka wants to merge 1 commit intoopen-telemetry:mainfrom
yoshi-taka:fix/add-make-j-flag
Closed

Add MAKEFLAGS=-j$(nproc) to test and build-layer jobs#2274
yoshi-taka wants to merge 1 commit intoopen-telemetry:mainfrom
yoshi-taka:fix/add-make-j-flag

Conversation

@yoshi-taka
Copy link
Copy Markdown
Contributor

Parallelizes make targets across Go modules in collector, reducing CI wall time by up to 2-3x on multi-core runners.

This PR speeds up the collector CI test job by enabling parallel make execution.

The collector test workflow currently runs make gotidy and make gotest serially through the default Make behavior. Setting MAKEFLAGS: -j$(nproc) lets Make use the available runner CPU cores where the Makefile has independent work to execute.

Parallelizes make targets across Go modules in collector, reducing
CI wall time by up to 2-3x on multi-core runners.
@yoshi-taka yoshi-taka requested a review from a team as a code owner May 4, 2026 10:11
Copy link
Copy Markdown
Member

@wpessers wpessers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking the time to open a PR. Although I'm not sure we're solving an actual problem here? The test job even takes twice as long on your PR versus the average case (5m29s vs ~2m50s). And from what I read the MAKEFLAGS: -j$(nproc) would mostly be useful when your Make invocation runs multiple independent targets. That's not the case here since for-all-target (used for gotidy and gotest targets in our makefile) will recursively invoke make for each go module, sequentially. So there's nothing meaningful to parallelize here.

@yoshi-taka
Copy link
Copy Markdown
Contributor Author

Thanks for taking the time to review. I think your point is fair.

I rechecked the Makefile structure, and gotidy / gotest go through for-all-target, which delegates to each module sequentially. So adding MAKEFLAGS at the workflow level does not appear to create meaningful parallelism in the current target graph.

I’ll close this PR for now. Thanks again for your time and the helpful feedback.

@yoshi-taka yoshi-taka closed this May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants