Awesome, that looks very promising. The whole test suite runs up to about 5 times faster:
- 1 job -> make check 40.83s user 53.52s system 53% cpu 2:55.26 total
- 8 jobs -> make check 44.52s user 61.41s system 133% cpu 1:19.36 total
- 16 jobs -> make check 48.62s user 67.03s system 201% cpu 57.387 total
- 32 jobs -> make check 49.53s user 68.33s system 268% cpu 43.830 total
- 64 jobs -> make check 50.45s user 70.69s system 315% cpu 38.367 total
- 128 jobs -> make check 52.15s user 73.38s system 357% cpu 35.089 total
The number of jobs is MAX_CPUS.
With 128 jobs, there are 6 tests that often or always fail:
- A08time.ztst --x-x-x-xx --
- C03traps.ztst xxxxxxxxxx --
- V06parameter.ztst xxxxxxxxxx xx
- V08zpty.ztst x-xxx--x-- --
- V11db_gdbm.ztst xxxxxxxxxx xx
- V14system.ztst -x-x--xxxx --
The 'x's denote failures. The last two columns are runs with only 8 jobs. No other test failed but one more test than usual (D03procsubst.ztst) was skipped and maybe also some additional test cases. I haven't looked into why the tests failed or were skipped.
I build and run tests in-tree (I run 'make' and 'make check' in the zsh root directory). To make your patch work, I had to apply the changes in the attached patch.
I didn't want to install flock, so I did as suggested and implemented a solution based on 'zsystem flock'. I have no idea whether what I did makes any sense. With high numbers of jobs, like 128, the output looks somewhat garbled. In particular there is a big block of seemingly bogus text at the very beginning:
runtests.zsh: Running tests (via zargs -P128)...
7;file://maloja/Users/paltherr/work/zsh-dev/Test/workdir-for-hmalojap44320.parent-tmp/workdir-for-V11db_gdbm.ztst.unique/Users/paltherr/work/zsh-dev/Test/workdir-for-hmalojap44320.parent-tmp/workdir-for-Y04regexargs.ztst.unique7;file://maloja/Users/paltherr/work/zsh-dev/Test/workdir-for-hmalojap44320.parent-tmp/workdir-for-X04zlehighlight.ztst.unique7;file://7;file://7;file://7;file:///Users/paltherr/work/zsh-dev/[… more of the same …]
Philippe