Nov 20, 2026·9 min read
My Two Laptops Tied. Then I Ran the Tests in Parallel.

My Two Laptops Tied. Then I Ran the Tests in Parallel.

benchmarking
pytest
python
macos
linux
agents
claude-code
skep

I run my coding agents on two laptops: a MacBook Pro and a Fedora machine. My notes said “the Mac is the fast one, do coding there; Fedora does merges and Linux checks.” I had never measured it. So I asked Claude, inside the same agent setup I use for everything else, to benchmark both and tell me which is faster, how many agents each can run, and what work should go where.

The short version:

  • On the same code, the Mac is 1.65× faster on one core, 2× faster at its best multi-core throughput, and 3.3× faster at copying memory.
  • Fedora starts a tiny program (/usr/bin/true) about 7× faster, runs git init plus a commit about 7× faster, and creates small files about 3.5× faster.
  • Yet on skep’s real test suite, run one test at a time, the two machines tied: 23:05 against 22:35.
  • That tie only held for the serial run. skep’s own gates already run it with pytest-xdist on every logical CPU. Run that way (minus the gates’ coverage step) it takes 2:46 on the Mac and 3:39 on Fedora: about 20 minutes less per run.
  • xdist’s speed-up on each machine was close to that machine’s raw CPU scaling, which suggests the hardware sets most of the limit.

The two machines

MacBook ProFedora laptop
CPUApple M4 Pro, 14 cores (10 performance, 4 efficiency)AMD Ryzen 7 8845HS, 8 cores, 16 threads
Memory48 GB78 GB
DiskAPFS, 185 GB freebtrfs with zstd compression, 841 GB free
OSmacOS 27Fedora 45

On paper Fedora has more threads, more memory and more disk. The question was what that means for the work I actually give it.

Round one: the same code on both

Different Python versions run the same code at noticeably different speeds, and my system Pythons were 3.9 on the Mac and 3.15 on Fedora. So the agent pinned Python 3.12 on both, wrote one stdlib-only script, and waited for another agent’s test suite on the Mac to finish first. The Mac still had some background activity after that (other agents come and go), so if anything its numbers are a little low.

One more trap: Fedora’s home disk uses btrfs with zstd compression, so writing zeros would inflate its write speed. The disk test writes random bytes.

TestMacFedoraWinner
One core, mixed Python work0.43 s0.71 sMac, 1.65×
Best multi-core throughput, work per second16.07.95Mac, 2.0×
SHA-256, native code2,894 MiB/s2,182 MiB/sMac, 1.3×
Copy 1 GiB in memory58.4 GiB/s17.8 GiB/sMac, 3.3×
Sequential disk write, 2 GiB2,700 MiB/s3,019 MiB/sabout even
Create 20,000 small files1.90 s0.55 sFedora, 3.5×
Start /usr/bin/true 1,000 times2.67 s0.38 sFedora, 7.0×
git init, add, commit, 100 times5.18 s0.77 sFedora, 6.7×

The all-cores row hides a detail. The Mac kept getting faster up to about 12 parallel jobs. Fedora levelled off at 8: going from 8 workers to 16 added only 15%. Its 16 threads behave like 8 cores plus a little, because two threads on one core share that core’s hardware.

If I had stopped at the top half of this table, the answer would have been “the Mac, by about 2×.”

Round two: a real workload, and a tie

Synthetic numbers are a guess about real work, so the agent ran skep’s full test suite (about 5,550 tests, same commit) on both machines.

MacFedora
skep suite, uv run pytest23:0522:35

A machine that is 1.65× faster per core, and the slower machine wins by 30 seconds.

My best explanation is the bottom half of the table. skep’s tests start a lot of processes: workers, sandboxes, git repositories in temporary folders. Starting a tiny program and waiting for it took about 2 ms longer on the Mac, and starting a Python interpreter about 10 ms longer. I didn’t count how many the suite starts, but process starts and small files are the only places Fedora clearly wins, and it wins by 3.5× to 7×.

An honest footnote: Fedora’s run also had 69 failures. With the settings I come back to below it had one, a missing node. I don’t know how much the failures changed its time, so treat this row as approximate. The tie was still close enough to need an explanation.

Why true starts 7× faster on Fedora

The agent timed three operations separately; both process timings include waiting for the child to exit:

StepMacFedora
Copy a running process (fork)1.8 ms0.85 ms
Start a new program (posix_spawn)2.5 ms0.35 ms
Create one 4 KB file61 µs22 µs

Two things stand out.

On Linux, starting a program is cheaper than copying a process. Modern glibc’s posix_spawn doesn’t copy the parent’s memory map. The child shares the parent’s memory only until it calls exec, which gives it a fresh address space, so nothing is duplicated.

On macOS, starting a program is expensive even without the copy. Apple’s posix_spawn doesn’t copy either, and it still takes 2.5 ms. true itself does almost nothing, so most of that is the cost of starting and ending a process. These are known design differences, not things I measured one by one:

  • Every macOS process is two kernel objects, a Mach task and a BSD process.
  • Code signatures are validated as a program’s code loads, and native Apple Silicon code must be signed.

Small files were slower on the Mac too, and I didn’t measure why. Right after another agent’s test suite finished, I saw fseventsd, the service that logs file changes for file watchers and backup tools such as Time Machine, using 67% of a core. I checked for third-party antivirus too. There is none on that Mac, only Apple’s own XProtect.

None of this makes macOS badly built; starting a program just took longer here. That only adds up when a workload starts a great many programs, and skep’s suite probably does.

Round three: the tie only held one test at a time

With the tie explained, I asked the agent to add pytest-xdist to skep so the suite would run faster.

It came back and said skep already uses it. My own CLAUDE.md for skep lists the gate command, and CI runs a close variant. Without its coverage options it is:

TMPDIR=$HOME/.cache/skep-test-tmp uv run --with pytest-xdist pytest -n auto

The benchmark had run plain uv run pytest, one test at a time, without the TMPDIR setting. The Linux sandbox needs that setting: it hides /tmp from the code it runs.

So we ran it again with those settings (still without coverage, which adds some time):

One test at a timexdist, -n autoSpeed-upSaved per run
Mac23:052:46, no failures8.3×20.3 min
Fedora22:353:39, 1 failure6.2×18.9 min

With those settings, 68 of Fedora’s 69 failures went away. The one left is a web UI test that needs node, which that machine doesn’t have.

Run the way my gates run it, the Mac is 1.3× faster. My reading: run one at a time, the suite spends much of its time on the things the Mac does slowly. In parallel, the Mac pulled ahead again.

The part I like least: before we caught this, the agent had already written the wrong conclusion into my shared fleet notes. It said the suite takes 23 minutes and my one-suite-at-a-time lock could probably be relaxed. Both were wrong, and the lock is exactly what stops two parallel suites from fighting over the same cores. It corrected the notes within the hour. The lesson went into the notes too: time a suite with the exact command the project’s gates use, never plain pytest.

The 20 minutes is real, just not where I first thought. My gates and CI already had it. make test and make unit in skep still call plain uv run pytest, so anyone typing make test waits 23 minutes instead of about 3.

What pytest-xdist actually does

-n auto started one worker per logical CPU here: 14 on the Mac, 16 on Fedora. (It counts physical cores instead only when the psutil package is installed, and it isn’t in skep’s setup.) Each worker loads the full list of tests. A coordinator hands tests to whichever worker is free and gathers the results into one normal pytest report. The tests themselves don’t change.

There’s one catch: tests running side by side must not fight over the same resource. Two tests that both bind port 8765, or write to the same file, will fail at random when they run side by side. skep’s notes call the suite xdist-safe (a few order-dependent tests have been fixed since), and both parallel runs on the Mac passed.

Why 8× and not 14×

My first guess was Amdahl’s law: the part of a job that can’t be split limits how much faster extra cores can make it. Working the formula backwards from 8.3× on 14 cores suggests about 5% of the suite is serial, and a hard ceiling near 19×.

Then I ran the suite once more with --durations=10 to find that serial part:

TimeTest
18.5 stest_grants_v3.py::test_no_grant_verdict_is_wider_than_before_but_b101_and_b18[legacy]
15.3 sthe same test, [zero]
14.2 stest_card_folding.py::test_a_fold_a_messenger_cannot_show_in_full_needs_the_web_ui
13.9 sthe same grants test, [builder]
13.6 sthe same grants test, [assistant]

Eight of the top ten are two “matrix” tests. Each case checks one to two thousand policy decisions for one kind of home against saved answers, all inside one test. xdist can’t split a single test, so each runs on one worker.

That list didn’t explain the scaling, though. The run took 2:30 end to end (pytest reports 2:21). Loading the test list takes 1.7 seconds and the longest test 18.5 seconds, so neither accounts for a 2:30 run on its own. I didn’t measure the rest of the overhead, such as starting the workers. Together the ten slowest took 133 seconds, roughly 6 to 7% of the time 14 workers had available. Spread evenly, that is about 10 seconds of wall time.

A likelier explanation was already in round one. In the synthetic benchmark the Mac’s best multi-core result was 7.9× its single-core speed, and Fedora’s was 6.5×. The test suite got 8.3× and 6.2× in the runs above; the Mac’s second run, the one with --durations, came out at 9.2×. That is close to what the hardware itself managed, which suggests the CPUs set most of the limit: four of the Mac’s cores are slower efficiency cores, all of them share one memory system and one disk, and Fedora’s 16 threads are really 8 cores. I didn’t measure the suite’s balance directly, so this is the best fit, not proof.

What goes where now

Memory isn’t what limits how many agents I run: the agent processes I sampled used about 175 MB on average and 540 MB at most, and an agent that is thinking uses almost no CPU. The limit I’ve actually hit is the API: seven agents across both machines hit the Claude rate limit earlier this month. So: three or four agents on the Mac, one or two on Fedora (three at most), five at most in total, and one full test suite at a time per machine.

On the Mac: coding and review agents, because compiling, type checking, linting and parallel test runs are CPU-bound. Also local models and anything memory-heavy, where its 3.3× faster memory helps most.

On Fedora: merges, the final gate run, pushes and pull requests; the coverage-free suite run was about a minute slower there. Also anything that starts lots of processes or touches lots of files: npm installs, heavy git work, containers (no virtual machine needed on Linux), and the Linux-only sandbox tests. And long-running jobs that want 78 GB of memory or a lot of disk.

What I’d keep from this

  • Add one real workload to every benchmark. The synthetic numbers said 2×, the suite said a tie, and both were true for different kinds of work.
  • Measure process starts. If your workload starts thousands of programs, the operating system matters as much as the CPU.
  • Time the command your gates run. My tie was measured with the serial command behind make test, not the one my gates use.
  • Check your Amdahl’s-law guess against --durations. The slowest tests alone didn’t explain the scaling, so my estimate of the serial part is still untested.

How this was measured: the same Python 3.12 and the same stdlib-only scripts on both machines, run on 19 and 20 November 2026, skep at commit 2bf2644. The Mac shares its CPU with my other agents; I waited for another agent’s suite to finish before the synthetic run, and when one re-run overlapped another agent’s suite I used the clean run. macOS can report a disk write as finished before it reaches the drive, so treat the Mac’s disk-write figure as an upper bound.