TL;DR
PerfArena is an open-source, reproducible benchmarking platform that ranks LLMs based on the latency, memory, and energy efficiency of the code they generate. By evaluating 13 state-of-the-art models across seven programming languages, the researchers demonstrate that functional correctness is a poor proxy for performance, with "correct" solutions from different models varying in execution speed by as much as 3.6x.
What Problem Does This Paper Address?
As AI generates an increasing share of the world’s production code—reaching an estimated 75% at Google by 2026—the efficiency of that code becomes a critical economic and environmental factor. However, most existing benchmarks like HumanEval or EvalPlus focus almost exclusively on functional correctness: does the code pass the unit tests?
The authors argue that this narrow focus creates a "performance loop of hell." LLMs are trained on human-written code, which often prioritizes readability or speed of development over execution efficiency. Consequently, LLMs frequently produce code riddled with performance anti-patterns. Existing performance-oriented benchmarks are often limited to a single language (usually Python) and rarely account for energy consumption, which is vital for mobile and cloud-scale deployments.
Methods
The authors introduce PerfArena, a pluggable architecture designed to measure code performance under a rigorous, reproducible protocol.
Key methodological innovations include:
- The Performance Oracle: Instead of relying on inconsistent cloud-based judges, PerfArena uses a custom harness on dedicated hardware. To mitigate noise from JIT compilers and system overhead, it uses a "warmup" phase followed by a measured window of repeated executions.
- Multi-Metric Tracking: It simultaneously tracks execution latency, peak memory (Resident Set Size), and energy consumption (using Intel’s RAPL interface and CodeCarbon).
- Bradley-Terry Ranking: Similar to the Elo system used in chess or the Chatbot Arena, PerfArena uses head-to-head "duels" between models on specific problems to calculate a win probability and rank them.
- Cross-Language Uniformity: Every solution for a given problem is measured using the same protocol and execution conditions across all seven supported languages.
Datasets
The paper evaluates models using two distinct "competitions":
- CLBGComp: 10 compute-intensive benchmarks from the Computer Language Benchmarks Game, designed to push the limits of language runtimes.
- LeetCodeComp: A curated subset of 99 LeetCode problems. The authors didn't just pick these at random; they used a "fingerprinting and clustering" pipeline to select problems where algorithmic choices lead to measurable, discriminative differences in performance.
The evaluation covers seven programming languages: C++, C#, Java, JavaScript, PHP, Python, and TypeScript.
Key Insights and Ideas
- Correctness $\neq$ Efficiency: While 12 of the 13 tested LLMs passed over 90% of the LeetCode problems, the execution speed of their "correct" solutions varied wildly. The slowest model's code took 1.6x longer on average than the fastest on LeetCode, and 3.6x longer on the compute-heavy CLBG tasks.
- The Language Gap: A model’s performance rank is not constant across languages. For instance,
claude-opus-5-5leads in Python and PHP, butgpt-6-astradominates the other five languages. - Price Doesn't Buy Speed: High-cost models do not necessarily generate faster code. The authors found that
gpt-6-astrais significantly more cost-effective per "correct and efficient" solution than more expensive competitors likeclaude-fable-5-1. - Energy Follows Latency: In most cases, the fastest code is also the most energy-efficient. However, on whole-program benchmarks (CLBG), the fastest solutions often draw more peak power, slightly narrowing the energy-efficiency gap compared to the latency gap.
Key Results
The researchers evaluated 13 models from providers like OpenAI, Anthropic, Google, and DeepSeek.
- The Dominant Model:
gpt-6-astraemerged as the clear leader. It was the only model that no other LLM could beat significantly in latency, energy, or memory across both competitions. - Quantitative Gaps: On average, correct solutions from other LLMs had 1.1–1.6x the latency of
gpt-6-astraon LeetCodeComp and 1.2–3.6x on CLBGComp. - Memory Stability: Unlike latency and energy, peak memory usage was relatively stable across models, likely because the language runtimes themselves account for the bulk of the memory footprint in these specific tasks.
Limitations and Future Work
- Hardware Dependency: Performance measurements are hardware-specific. While the relative ranking of models is likely to hold across similar architectures, absolute values would change on different CPUs or OSs.
- Data Contamination: Since LeetCode and CLBG are public, there is a high risk that models have seen these solutions during training. The authors acknowledge this but argue that PerfArena’s value lies in its ability to be updated with new, private, or "live" competitions.
- Single-Shot Focus: This study used single-shot prompts. Future work could explore how agentic workflows (where models iterate on their own code) impact the final performance footprint.
- Expansion: The authors plan to continuously update the live leaderboard as new models are released.
Summary updated