Skip to content

Add --jobs to allowedCliOpts to allow control of CPU usage

Simon Street requested to merge ss-add-jobs-env-202403 into main

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?

Edited by Simon Street

Merge request reports