Out of 82 agent-written pull requests that promised to make code faster, 22 made it slower. Another 28 showed no clear change. Only 32 actually sped things up, and the reason the PR gave for the speed-up showed up in the measurements for 34 of the 82.
Those numbers come from Below the Stopwatch: Checking the Performance Claims of Coding Agents in the Kernel, by Sehgal, Patel, Panahandeh and Ezzati-Jivan. What I like about it is that it doesn't stop at "did it get faster". It asks a harder question: did it get faster for the reason the agent said?
A stopwatch can show that code got faster, but not that it got faster for the stated reason.
That one line names a review habit I'm guilty of. An agent opens a PR saying "cache the parsed config so we don't re-read it per request". The explanation sounds right, the diff matches the story, and I merge it. Usually nobody measures anything, and the paper shows how common that is.
Most speed-up PRs come with a story, not a measurement#
The authors started from AIDev, a large public dataset of agent-authored PRs. They used keyword filtering and LLM labeling to find 1,343 runtime-performance PRs, mostly in Python. Before running anything, they read what those PRs claimed:
57.3% offered only reasoning or no evidence at all (500 reasoning-only, 269 with nothing)
Only 31.4% stated an effect size
221 PRs (16.5%) cited a benchmark, and just 6 cited a profile
14.1% didn't name any mechanism
The most common claimed mechanisms were skipping unneeded work (20.6%), fewer copies or less memory (16.6%), and caching (15.3%). All three are easy to describe and easy to believe, and none of them is easy to confirm by reading the diff.
A blind build agent, three runs of base, and a kernel trace#
The method is the part I'd steal. For each PR, Claude Code acts as a build agent that never sees the PR text, the claim, the commit messages or the git history. Its job is to build base and head and write a deterministic workload that exercises the changed code. The workload has to cover at least 80% of the changed lines (50% for large PRs), run between 0.5 and 30 seconds on base, and make no network calls. Building a workload cost about $0.37 per PR.
Each PR then runs as base, head, and base again. The second base run is an A/A control, and it's the detail that makes me trust the rest. For each variant they collect 10 timing runs, hardware counters, and 5 full LTTng kernel traces. A PR only counts as "faster" if median wall time drops by at least 5% and every head run beats every base run. A mechanism only "holds" if its expected signal (fewer read syscalls for a caching claim, for example) moves at least 10% in the right direction, with the same every-run-beats-every-run rule. Run against base-vs-base, the checks fired on 0 of 1,796 tests.
The kernel traces matter because instruction counts can't tell mechanisms apart. Almost any speed-up removes instructions. Among faster PRs, instruction count dropped for 87.9% of claimed mechanisms and 76.7% of unclaimed ones, a ratio of only 1.15×. Kernel signals moved for 48.8% versus 28.7%, about 1.7×. Across all PRs the gap was 3.1×. Syscalls, page faults and blocking time say something about why a change is faster. A stopwatch can't.
Faster and right are different checks#
The outcome table is where the story gets interesting:
Faster, mechanism held: 28
Faster, mechanism absent: 4
Slower, mechanism held: 3
Slower, mechanism absent: 19
No clear change: 28 (25 with no sign of the mechanism)
When a PR really was faster, the stated reason was usually true (28 of 32). When a PR was slower, the stated reason was almost always missing (19 of 22). So the explanation isn't random noise, and it tracks reality when the change works. The trouble is that you can't tell which case you're in from the PR description. A confident, well-argued claim looks exactly the same in both.
The examples make this concrete. In one Copilot PR on iPhotron, the code ran at 0.88× of base time, so it was faster. But it made 3.49× the system calls and 11.56× the pread64 calls, and the trace didn't support the SQL pagination fix the PR described. A Jules PR on the same repo was 11.35× slower on a workload with 500 thumbnail files, with getdents64 calls up 41.82×. A Claude Code PR got half its mechanism, with non-blocking I/O present and connection pooling absent, and ended up 1.47× slower with futex calls up 2.86×.
There's a second warning that's easy to miss. The workload's output changed in 42 of the 82 PRs, through things like new defaults or different error messages. A "performance" PR that also changes behavior is two PRs in one, and a reviewer who reads the title will only review one of them. In 21 PRs, at least one resource such as memory, page faults, syscalls or bytes read got clearly worse.
Eighty-two PRs is a pilot, not a leaderboard#
I wouldn't read anything into the per-agent table. Claude Code had 22 PRs, Jules 15, Devin 15, Codex 12, Copilot 10 and Cursor 8, and the authors don't report per-agent effect sizes. Up to 15 PRs come from a single repo. Each PR was measured once, on one machine type. A planned human check of 300 PRs hasn't been done yet.
Two more threats seem real to me. First, the blind build agent can write a workload that never reaches the code path the claim is about, such as a cache that never gets a repeat hit, or a file-size optimisation run on small files. Some "mechanism absent" verdicts may really mean "workload never got there". Second, Claude models did the labeling, extracted the claims and built the workloads, and Claude Code is also one of the agents being judged. The authors say this openly, but it's still one model family grading itself. External services are stubbed out too, so network-bound speed-ups go unmeasured.
Even with all that, the 22 slower PRs aren't a measurement quirk. The A/A control and the strict every-run-beats-every-run rule make false "slower" verdicts unlikely. The open question is how often, not whether.
Make the agent bring the trace#
Here is what I'm changing. Any agent PR in my repos that claims a performance mechanism now has to include a workload and a before/after measurement. That means wall time plus the one signal that should move if the claim is true: read or write syscalls for caching, page faults or RSS for fewer copies, off-CPU time for async I/O. If the claimed signal doesn't move, the PR gets rewritten or closed, however good its reasoning sounds.
The paper's pipeline also maps well onto a sub-agent setup. One agent writes the optimisation. A second agent, which never sees the claim, writes the workload. A plain script runs base, head, base and diffs the counters. The blindness is what makes this work, because an agent that knows the claim will tend to write a benchmark that confirms it. I'd also keep the A/A run. It's cheap, and it catches the noisy-machine runs that otherwise turn into fake 6% wins.
My prediction: within a year, "performance" will be a PR category that agent harnesses refuse to label without attached evidence, the way CI already refuses to merge without green tests. The data here says the evidence is cheap to collect. Agents just weren't asked for it.