GNU Parallel Is Slower Than Serial: xargs -P vs GNU Parallel vs Serial, Measured
GNU Parallel, the tool built for parallelism, is slower than a serial loop at every job count on short jobs, and it floors at about 0.61 seconds on the heavy arm while xargs keeps scaling to 11.90x. The same probe the night before said 6.44x for xargs over parallel at 32 jobs; the fresh run says 6.03x. The direction held both nights.
Written November 8, 2026 · 16 min read
- The fresh run: the heavy arm
- The fresh run: the tiny arm, where parallel loses to serial
- Last night said 6.44x; today says 6.03x
- The unstable arms
Edited November 18, 2026
What this guide is
This guide times the three-way comparison the nearest existing measurement never runs: serial loop against xargs with the parallel flag against GNU Parallel, at five job counts, on a CPU-bound task, with medians. The nearest piece is pixelbeat, which measures xargs and GNU Parallel only on counting lines in a file, at a single job count, with no serial arm and no medians. Its fastest xargs run took 0.131 seconds and its GNU Parallel pipe run took 1.863 seconds, but those are single runs of a trivial per-item cost, not a scaling sweep. A second guide quotes overhead figures, about 0.3 milliseconds per job for xargs against about 3 milliseconds per job for GNU Parallel, with no measured table behind them. A third publishes GNU Parallel only, an audio transcoding job falling from 85 seconds serial to 32 seconds at four jobs and 9 seconds at 36 jobs, with no xargs arm at all. None of them answers the question this guide asks: on the same jobs, on the same box, which tool actually wins, and where does the parallel tool lose to doing nothing at all.
The headline is a correction, not a speedup. On short jobs, GNU Parallel loses to a serial loop at every job count, on both nights. Its best tiny-arm time, 2.564 seconds at four jobs on the fresh run, is 1.71 times slower than the serial loop at 1.503 seconds, while xargs at four jobs on the same files is 3.63 times faster than serial at 0.414 seconds. Same jobs, same box, opposite signs. On the heavy arm, GNU Parallel stops improving after four jobs and sits at about 0.60 seconds no matter how many workers you add, while xargs keeps scaling to 11.90 times serial at 16 jobs. The tool built for parallelism is the slowest of the three on short jobs, and the plainest tool wins by the widest margin.
A note on scope before the numbers. This guide measures one task shape: many small CPU-bound jobs, each writing its hash to a file. The Ninja versus Make guide on this site measures a different parallelism layer, build-system dispatch against the same 32 cores, and none of it is repeated here. The two guides share the word parallel and nothing else.
The setup
The task is hashing files with SHA-256, one hash per file, output to a file per configuration. Two arms. The heavy arm is 200 files of 8 MiB each, 1,677,721,600 bytes in total, about 6.07 milliseconds per job serial on the fresh run. The tiny arm is 1000 files of 4 KiB each, 4,096,000 bytes in total, about 1.50 milliseconds per job serial. Eleven configurations per arm: the serial loop, xargs at 1, 4, 8, 16 and 32 parallel processes, and GNU Parallel at 1, 4, 8, 16 and 32 jobs. Three repetitions each, 66 timed runs, all returning 0.
while read -r f; do sha256sum "$f"; done < heavy.list > out.txt
xargs -a heavy.list -n 1 -P 16 sha256sum > out.txt
parallel --will-cite -j 16 sha256sum < heavy.list > out.txt
The toolchain is a 32-core WSL box, xargs from GNU findutils 4.9.0, SHA-256 from GNU coreutils 9.4, GNU Parallel 20231122, and bash 5.2.21. GNU Parallel is not installed, so the fresh run fetched the same Ubuntu package the night before used, extracted it without installing, and verified the version before timing anything. The fixtures were read into the page cache before timing, so every timed run here is warm-cache. The medians below are over the three timed runs only.
Correctness is the part the night before got wrong, and this run fixes it. The 2026-11-07 probe checked only the first hash of each output file, which is order-sensitive for tools that emit lines in no fixed order, and it showed three mismatch lines that were order artifacts. It never compared the full outputs. This run sorts every output file and compares it against the sorted serial reference for its arm. All 66 outputs compare identical after sorting. The hash sets are the same in every configuration, so the timing differences are dispatch differences, not different work. The legacy first-hash check still ran for continuity and showed one mismatch line, again an order artifact, and the sorted comparison is the verdict.
The fresh run: the heavy arm
| Config | Rep 1 | Rep 2 | Rep 3 | Median |
|---|---|---|---|---|
| Serial | 1.253 | 1.214 | 1.185 | 1.214 |
| xargs -P1 | 1.274 | 1.192 | 1.178 | 1.192 |
| xargs -P4 | 0.318 | 0.307 | 0.308 | 0.308 |
| xargs -P8 | 0.167 | 0.159 | 0.160 | 0.160 |
| xargs -P16 | 0.139 | 0.102 | 0.101 | 0.102 |
| xargs -P32 | 0.148 | 0.103 | 0.101 | 0.103 |
| parallel -j1 | 1.628 | 2.305 | 2.333 | 2.305 |
| parallel -j4 | 0.616 | 0.631 | 0.620 | 0.620 |
| parallel -j8 | 2.742 | 0.598 | 0.600 | 0.600 |
| parallel -j16 | 0.604 | 0.606 | 0.601 | 0.604 |
| parallel -j32 | 0.643 | 0.615 | 0.621 | 0.621 |
All times in seconds, wall-clock elapsed. All 66 runs returned 0, and all 66 outputs compare identical to the serial reference after sorting.
Read the xargs rows first. At one process it matches serial, 1.02 times as fast. At four it is 3.94 times serial, at eight 7.59 times, at 16 it reaches 11.90 times, and at 32 it stays at 11.79 times. The scaling stops at 16 of 32 cores: hashing is single-threaded per job, and the box hits its throughput ceiling before 32 workers. The direction is clean scaling up to that ceiling.
Now read the GNU Parallel rows. At one job it is slower than serial, 0.53 times as fast, taking 2.305 seconds against serial at 1.214. At four jobs it reaches 1.96 times serial, and then it stops. Four, eight, 16 and 32 jobs give 0.620, 0.600, 0.604 and 0.621 seconds: adding 28 more workers buys nothing. The floor is about 0.60 seconds for 200 jobs, about 3.02 milliseconds per job, which matches the manual's own startup figure of around 3 to 10 milliseconds per job. At 32 jobs, xargs at 0.103 seconds is 6.03 times faster than GNU Parallel at 0.621 seconds.
The fresh run: the tiny arm, where parallel loses to serial
| Config | Rep 1 | Rep 2 | Rep 3 | Median |
|---|---|---|---|---|
| Serial | 5.494 | 1.449 | 1.503 | 1.503 |
| xargs -P1 | 3.049 | 1.385 | 1.445 | 1.445 |
| xargs -P4 | 0.411 | 0.414 | 0.521 | 0.414 |
| xargs -P8 | 0.407 | 0.412 | 0.474 | 0.412 |
| xargs -P16 | 0.409 | 0.400 | 0.484 | 0.409 |
| xargs -P32 | 0.411 | 0.493 | 0.409 | 0.411 |
| parallel -j1 | 9.641 | 8.202 | 6.266 | 8.202 |
| parallel -j4 | 2.564 | 2.537 | 2.575 | 2.564 |
| parallel -j8 | 2.531 | 2.617 | 2.588 | 2.588 |
| parallel -j16 | 1.410 | 2.584 | 2.580 | 2.580 |
| parallel -j32 | 2.630 | 1.409 | 2.620 | 2.620 |
All times in seconds, wall-clock elapsed. All 66 runs returned 0, and all 66 outputs compare identical to the serial reference after sorting.
This is the trap, and it is the whole guide in one table. GNU Parallel is slower than the serial loop at every job count. At one job it takes 8.202 seconds against serial at 1.503, which is 5.46 times slower. At its best, four jobs, it takes 2.564 seconds, still 1.71 times slower than serial. At 32 jobs it takes 2.620 seconds, 1.74 times slower. No job count crosses the serial line. The floor is about 2.58 seconds for 1000 jobs, about 2.58 milliseconds per job, the same per-job dispatch cost as the heavy arm, now larger than the job itself: each tiny job takes about 1.50 milliseconds of hashing, and dispatch costs about 2.58 milliseconds on top of it.
On the same files, xargs goes the other way. At one process it matches serial at 1.04 times as fast. At four processes it is 3.63 times faster than serial, and it flatlines at about 0.41 seconds from four jobs up, which is about 0.41 milliseconds per job of fork and dispatch. The xargs floor is a sixth of the GNU Parallel floor on the same jobs, and it sits below the serial time instead of above it. The difference between the two tools on tiny jobs is not a few percent. It is the sign of the result.
Last night said 6.44x; today says 6.03x
| Run | Heavy serial | xargs -P16 | parallel -j16 | xargs -P32 over parallel -j32 | Tiny parallel -j4 over serial |
|---|---|---|---|---|---|
| 2026-11-07 | 1.183 | 0.101 | 0.614 | 6.44x | 1.75x slower |
| 2026-11-08 (fresh) | 1.214 | 0.102 | 0.604 | 6.03x | 1.71x slower |
Same fixture shapes, same commands, same box, different nights, and the medians barely moved. Heavy xargs at 16 jobs is 0.101 seconds one night and 0.102 the next. Heavy GNU Parallel at 16 jobs is 0.614 one night and 0.604 the next. The tiny parallel floor is 2.580 seconds one night and 2.564 the next. Every portable claim held: xargs scales to about 11.7 to 11.9 times serial on the heavy arm, GNU Parallel plateaus at about 0.60 seconds from four jobs up, GNU Parallel is slower than serial at every job count on tiny jobs, and xargs is about 6 times faster than GNU Parallel at 32 jobs on the heavy arm. The exact ratio moved from 6.44 to 6.03 because the GNU Parallel median at 32 jobs moved from 0.663 to 0.621 seconds, not because anything changed direction.
Two arms moved more than the rest, and both are first-job-count arms. Tiny GNU Parallel at one job ran 5.085 seconds the night before and 8.202 seconds on the fresh run, with repetitions spanning 6.266 to 9.641 seconds fresh against 5.060 to 6.249 the night before. Tiny serial rep 1 on the fresh run took 5.494 seconds against 1.449 and 1.503 for reps 2 and 3, and tiny xargs at one process showed the same first-rep shape at 3.049 seconds. First repetitions run slow, and medians absorb them, which is why this guide never quotes a single run.
The unstable arms
The tiny GNU Parallel eight-job arm was unstable the night before and stable on the fresh run, and the guide reports both. On 2026-11-07 its repetitions were 1.427, 2.599 and 2.623 seconds: the first repetition sits 45 percent below the other two, and the median of 2.599 seconds is used. On the fresh run the same arm gave 2.531, 2.617 and 2.588 seconds, no outlier, median 2.588. The outlier did not reproduce, so the guide claims no eight-job advantage: the fresh medians are 2.564 seconds at four jobs and 2.588 at eight, and the night-before medians are 2.580 at four and 2.599 at eight. Eight jobs is never faster than four on either night.
The fresh run has its own outliers, all on the same pattern. Heavy GNU Parallel at eight jobs gave 2.742 seconds on rep 1 against 0.598 and 0.600 on reps 2 and 3. Tiny GNU Parallel at 16 jobs gave 1.410 seconds on rep 1 against 2.584 and 2.580, and at 32 jobs gave 1.409 seconds on rep 2 against 2.630 and 2.620. Those low repetitions are about 45 percent below their siblings, the same size as the night-before eight-job outlier, and they appear and vanish without pattern. Medians absorb them. A reader who times one run of any of these arms can report anything from 1.409 to 2.742 seconds for the same work, so this guide quotes medians with ranges, never single figures, for every unstable arm.
What the manuals already tell you
The GNU Parallel manual, read fresh from the extracted 20231122 package, states the trade-off this probe measures: starting a job on the local machine takes around 3 to 10 milliseconds, and that can be a big overhead if the job takes very few milliseconds to run. It suggests grouping small jobs together to make the overhead less significant. The measured floors here, about 3.02 milliseconds per job on the heavy arm and about 2.58 on the tiny arm, sit at the bottom of that stated range, and the tiny arm shows what happens when the job itself is shorter than the startup: the tool spends more time starting jobs than running them.
The xargs manual, read fresh, says the parallel flag runs up to the given number of processes at a time, and that the one-item flag should be used with it, otherwise xargs accumulates input items and the parallelism thins out. Every xargs run in this probe passes one item per invocation, exactly as the manual prescribes.
The secondary guides point the same way and stop short of measuring it. Pixelbeat counts lines, a trivial per-item cost, at one job count, and its GNU Parallel pipe run at 1.863 seconds is its slowest method while xargs at 0.131 seconds is its joint fastest. The overhead-quoting guide gives the 0.3 against 3 millisecond figures with no table. The audio-transcoding guide shows GNU Parallel alone falling from 85 seconds to 9 seconds as jobs rise, which is the heavy-arm shape: long jobs hide the dispatch cost. None of them runs the tiny arm, where the dispatch cost is larger than the job, and none of them runs a serial arm to catch the case where the parallel tool loses outright.
What this guide does not cover
The scope is warm cache only: the fixtures were read into the page cache before timing, and cold-cache numbers were not measured and will be worse for both tools. The scope is one task shape: SHA-256 hashing is CPU-bound with trivial output, one hash line per file, written to a file per configuration. Jobs that wait on disk or network, jobs with large output, and jobs that need output grouping were not measured, and this guide does not claim xargs wins those. GNU Parallel has grouping and ordering flags this probe did not use, and its remote-execution mode was not tested. The floors reported here are measured per-job dispatch, not a universal constant: the heavy floor is about 0.60 seconds for 200 jobs and the tiny floor about 2.58 seconds for 1000 jobs, and both move with the machine. GNU Parallel was extracted from its package, not installed. The box is WSL with 32 cores, so the direction is the portable part and the exact ratios, 6.03x and 11.90x, are not.
Checklist
- Before reaching for GNU Parallel on short jobs, check the job length against the startup cost: if each job takes about 1.50 milliseconds and starting it costs about 2.58, the parallel tool runs slower than a serial loop.
- Before trusting a parallel speedup, check the serial arm: GNU Parallel at its best tiny-arm time is still 1.71 times slower than serial, and only a serial baseline catches that.
- Before quoting a ratio from one night, run the probe again: the xargs-over-parallel ratio at 32 jobs moved from 6.44 to 6.03 between two runs, while every direction held.
- Before timing one run, check the median and the range: single repetitions in this probe ranged from 1.409 to 2.742 seconds for the same arm, and a first repetition can run 5.494 seconds where the median is 1.503.
- Before choosing between the tools, check the floor: GNU Parallel stops improving after four jobs at about 0.60 seconds on the heavy arm, while xargs keeps scaling to 11.90 times serial at 16 jobs.
- Before applying these numbers to another workload, stop: jobs that wait on disk or network, jobs with large output, and jobs that need grouped output were not measured here.
Related guides on this site
- Copying a 1 GiB File: dd at bs=512 Is 9x Slower — and cp Ties dd Once the Block Size Is Right
- rsync's 2,729x Speedup Is 1% Slower on the Clock: Delta vs Whole-File, Measured in Wall-Clock
- Searching, Reading, and Rewriting Text: Twelve Measured Guides
- Measured Comparisons: 9 Guides From November 8, 2026
Sources
- pixelbeat, Parallel processing with unix tools — read in full 2026-11-08: the nearest existing measurement, counting lines only, single job count, no serial arm, no medians; xargs at the core count 0.267 and 0.131 seconds, joint fastest; GNU Parallel pipe 1.863 seconds; cached files, not disk-bound.
- parallel(1) manual — the mechanism primary, read fresh from the extracted GNU Parallel 20231122 package on the box 2026-11-08: starting a job on the local machine takes around 3 to 10 milliseconds, which can be a big overhead if the job takes very few milliseconds to run; grouping small jobs makes the overhead less significant.
- xargs(1) manual — read fresh on the box 2026-11-08 (GNU findutils 4.9.0): the parallel flag runs up to the given number of processes at a time, and the one-item flag should be used with it.
- copyprogramming, How to Run an Executable in Terminal in Parallel — read in full 2026-11-08: quotes the overhead figures, about 0.3 milliseconds per job for xargs against about 3 milliseconds per job for GNU Parallel, with no measured table; comparison table repeats the same figures.
- thelinuxcode, Unleash the Power of Parallel Computing in Bash with GNU Parallel — read in full 2026-11-08: GNU Parallel only, audio transcoding on a 4-core system from 85 seconds serial to 32 seconds at four jobs and 9 seconds at 36 jobs; no xargs arm, no serial-versus-parallel trap.
- Veldica, Ninja vs GNU Make, Measured — the sibling guide: build-system parallelism on the same 32 cores, a different dispatch layer from the shell tools measured here.
- Veldica, Bash Strict Mode, Tested: Six Traps, Each Failing and Then Fixed — the sibling guide for the shell scripts that run tools like these: six strict-mode traps that let a script carry on after a failure, each one shown failing first and then fixed under a bats test suite.
Keep Exploring
Paste a [Service] section and get a plain-language verdict on every sandboxing setting it finds.
Paste sshd -G output and get a hardening verdict on the values your server actually runs.
Paste a server block and get WebSocket, TLS, HSTS, and proxy-header verdicts.
Paste a systemd timer expression and get the specific reason it fails, the normalized form, and the past-date traps the built-in check hides.
The full sysadmin hub \u2014 systemd, cgroups, file tools, and measured Linux comparisons.