Cameleering / AI code and performance
Cameleering · the evidence
AI-generated code and performance: what the evidence says
Coding agents make code cheap to produce. Whether that code is fast, small and correct is a separate question, and the research is younger and more mixed than either side of the debate admits. Here is what the studies measured, with their limits next to every finding.
No claim without a number.
The short version
- On benchmarks, generated code is usually correct before it is efficient. Several 2024 studies found models write slower code than good human solutions, and bigger models were not reliably faster.
- Models can also make code faster when that is the task and the result is measured.
- Productivity results are moving. A 2025 controlled study found experienced developers slower with AI; its 2026 follow-up points the other way but cannot measure it cleanly.
- Across the industry, duplicated code and delivery instability rose as AI adoption grew. That is correlation, not proof of cause.
The practical conclusion does not depend on which study is right: measure the software you ship, whoever or whatever wrote it. That is what the method is for.
Benchmarks of generated code
| study | what it measured | finding | limits |
|---|---|---|---|
| EffiBench, NeurIPS 2024 [1] | 1,000 efficiency-critical coding problems, 42 models, against human reference solutions | GPT-4's code took 3.12x the execution time on average, up to 13.89x, and up to 43.92x the memory; the best average time ratio was 2.59x | Python, algorithm puzzles; depends on the test environment |
| Mercury, 2024 [2] | 1,889 Python tasks, scored on correctness and on a runtime-weighted score | leading code models reached about 65% on correctness but under 50% on the efficiency score | Python tasks |
| EvalPerf, 2024 [3] | 121 performance-challenging tasks, profiled on expensive inputs | larger models did not reliably write more efficient code; instruction tuning helped both correctness and efficiency | a curated task set |
| ECCO, 2024 [4] | writing and editing code for efficiency | most methods made code moderately faster at a cost in correctness; feedback from running the code helped keep it correct | Python |
When AI makes code faster
- PIE (ICLR 2024): trained on more than 77,000 pairs of slower and faster C++ submissions, the best setup reached a mean speedup of 6.86x over eight attempts, against 3.66x for the average human optimization [5]. Limits: competitive-programming code, timed in a simulator.
- AlphaDev (DeepMind, 2023): sorting routines found by reinforcement learning were merged into LLVM's C++ standard library; up to 70% faster for very short sequences and about 1.7% for more than 250,000 elements [6].
The pattern in both: performance was the goal and the result was measured. That is the same discipline cameleering asks of people.
Developer speed is not product speed
METR, July 2025
16 experienced open-source developers, 246 real issues in their own large repositories, each randomly assigned to "AI allowed" or not. With AI, tasks took 19% longer, while the developers believed they had been about 20% faster [7]. METR says the result does not show that AI slows most developers: the sample is small, the setting specific, and later tools or more practice could change it.
METR, February 2026 follow-up
57 developers and more than 800 tasks: tasks took an estimated 18% less time for returning developers (confidence interval −38% to +9%) and 4% less for new developers (−15% to +9%), so both intervals include no change [8]. METR calls the estimate a poor proxy, because many developers would no longer work without AI and withheld tasks, and it believes speedups are now larger than in early 2025.
Either way, these studies measure how fast people finish tasks, not how fast the resulting software runs. Shipping code faster and shipping faster code are different claims.
Industry-wide signals
- DORA 2024 (Google Cloud): for each 25% increase in AI adoption, documentation quality rose 7.5% and code quality 3.4%, while estimated delivery throughput fell 1.5% and delivery stability 7.2% [9]. These are survey associations. The 2025 report found AI now associated with higher throughput, with instability still rising, and describes AI as an amplifier of a team's existing strengths and weaknesses [10].
- GitClear 2025: in 211 million changed lines from 2020 to 2024, duplicated code blocks rose about eightfold in 2024, and copy-pasted lines outnumbered moved (refactored) lines for the first time [11]. GitClear cannot tell which lines AI wrote, so this is a trend during the years AI spread, not a measurement of AI.
- Security: in a Stanford study (CCS 2023), participants with an AI assistant wrote less secure code on four of five tasks and were more confident in it [12]. Veracode's 2025 test of more than 100 models found about 45% of outputs chose an insecure option [13]; Veracode sells security tools.
What to do about it
| practice | why |
|---|---|
| Put performance budgets in CI: startup, memory, size, p99 | a generated change that doubles memory fails the build, like a failing test |
| Ask for efficiency explicitly, and measure the answer | the studies that found speedups made performance the task and checked it |
| Watch duplication and dependency count | copied code and pulled-in packages cost size, start time and audit work |
| Review with numbers, not impressions | developers in the 2025 study felt faster while measuring slower |
Common questions
Is AI-generated code slower than human code?
On efficiency benchmarks from 2024, usually yes: in EffiBench, GPT-4's solutions took 3.12 times as long as human reference solutions on average, and other benchmarks found models more often correct than efficient. When models are asked to optimize and the result is measured, they can make code faster. The benchmarks are mostly Python puzzles, so measure your own code.
Does AI make developers slower?
One 2025 randomized study of 16 experienced developers found tasks took 19% longer with AI. Its 2026 follow-up estimated tasks took 18% less time for returning developers, but with a confidence interval that includes no change, and its authors believe speedups have grown. The evidence is unsettled, and it measures developer time, not software speed.
Does AI-generated code cause bloat?
There are signals: GitClear found duplicated code blocks rose about eightfold in 2024, and DORA associated more AI adoption with lower delivery stability. Neither can attribute the change to AI directly. Budgets in CI catch growth in size and memory whatever its cause.
How do I keep AI-written code efficient?
Treat efficiency like correctness: set budgets for startup, memory, size and tail latency, check them in CI, ask for efficient code explicitly, and review changes with measurements.
Sources
Checked on 2026-11-12.
- Huang et al., "EffiBench: Benchmarking the Efficiency of Automatically Generated Code", NeurIPS 2024.
- Du et al., "Mercury: A Code Efficiency Benchmark for Code Large Language Models", 2024.
- Liu et al., "Evaluating Language Models for Efficient Code Generation" (EvalPerf), 2024.
- Waghjale et al., "ECCO: Can We Improve Model-Generated Code Efficiency Without Sacrificing Functional Correctness?", 2024.
- Shypula et al., "Learning Performance-Improving Code Edits", ICLR 2024.
- Google DeepMind, "AlphaDev discovers faster sorting algorithms", 2023.
- METR, "Measuring the Impact of Early-2025 AI on Experienced Open-Source Developer Productivity", July 2025.
- METR, uplift study update, 24 February 2026.
- Google Cloud, "Announcing the 2024 DORA report".
- Google Cloud DORA, State of AI-assisted Software Development 2025.
- GitClear, "AI Copilot Code Quality: 2025", as reported by DevClass.
- Perry et al., "Do Users Write More Insecure Code with AI Assistants?", CCS 2023.
- Veracode, 2025 GenAI Code Security Report.