Use all available threads for analysis #149
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
getThreadsFlagto default to using all available cores instead of just 1. This makes the behaviour matchgetMemoryFlagwhich uses all available memory.I've tried testing this by analyzing git, as an example of a medium-sized repository. These are the times for the "Perform CodeQL Analysis" step, so it excludes stuff like downloading and unpacking the action. I tried on a github.com cloud worker which have 2 cores and 7GB memory, and with a self-hosted runner with 8 cores and 64GB memory.
mainbranch, cloud worker = 8m 16smainbranch, self hosted worker = 6m 57smax_threadsbranch, cloud worker = 8m 45s (I hope this slight increase is just a fluke)max_threadsbranch, self hosted worker = 2m 24sIt's worth noting this PR is still only applying the number of threads to analysis. The other place we might get reasonable improvements is to extraction of scanned languages (i.e. javascript / python / go). I think we can do that separately though and get the various language teams involved to make sure we're doing the right thing.
Merge / deployment checklist