I was using:
./scripts/run_in_build_env.sh "./scripts/tools/zap/generate.py -t src/app/common/templates/templates.json -o zzz_generated/app-common/app-common/zap-generated"
This ran in over 90 seconds on my machine and showed 3% CPU usage throughout, so assuming this is single-threaded processing.
We should figure out if we can speed up this processing.