Add --jobs to allowedCliOpts to allow control of CPU usage
What does this MR do?
Follow up to phpcs-security-audit!104 (closed)
Adds --jobs
to allowedCliOpts
Allows semgrep
to use more CPU cores if present on a runner to speed up jobs on large code bases.
Timings from sample jobs against a large PHP code base for step_script
(4 being default, the runner has 8 cores (e2-highcpu-8
)):
jobs | time 1,2 |
---|---|
1 | 2:21, 2:20 |
2 | 1:33, 1:33 |
3 | 1:16, 1:17 |
4 | 1:08, 1:18 |
5 | 1:05, 1:06 |
6 | 1:11, 1:04 |
7 | 1:04, 1:03 |
8 | 1:02, 1:03 |
Interesting that it seems to taper off (although not very scientific), it looks like it spends a reasonable portion of time in a single process (I guess building the file lists and preparing) before it spins up the jobs and this flag doesn't speed that up. Some of this variation may be due to me using a e2
machine.
What are the relevant issue numbers?
n/a
Does this MR meet the acceptance criteria?
-
Changelog entry added -
Documentation created/updated for GitLab EE, if necessary -
Documentation created/updated for this project, if necessary -
Documentation reviewed by technical writer or follow-up review issue created -
Tests updated/added for this feature/bug -
Job definition updated, if necessary -
Conforms to the code review guidelines -
Conforms to the Go guidelines -
Security reports checked/validated by reviewer
Edited by Simon Street