]> granicus.if.org Git - strace/commit
xlat/gen.sh: speedup xlat generation
authorEugene Syromyatnikov <evgsyr@gmail.com>
Sat, 16 Sep 2017 00:30:40 +0000 (02:30 +0200)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 6 Nov 2017 19:21:58 +0000 (19:21 +0000)
commit04a65a183bb4d30d2504bc2ec04cc6802ed7cd54
treef7d31f7b63987ca053a6ef0e2e35f210d82523bc
parent4d8eedbd4fde86062d109b9b05d83c36223a4d6f
xlat/gen.sh: speedup xlat generation

This commit implements the following changes:
- increases the number of concurrent jobs to twice the CPU count;
- creates a circular buffer, so instead of running multiple jobs
  at once, the generator tries to keep about the same number of jobs
  being run concurrently;
- runs gen_git and gen_make concurrently in order to squeeze in
  one more bit of concurrency.

With my deeply scientific measurements, this approach achieves
up to 15% speedup with dash and about 30-40% with bash as /bin/sh
on a 4-core machine.

* xlat/gen.sh (main): Declare pids local variable, append pid of every
run job to it; increase the limit of jobs to ncpus * 2; when the limit
is reached, wait for the first pid in pids instead of resetting jobs
to zero and waiting for all the run jobs; put gen_git and gen_make
into background.
xlat/gen.sh