ConceptioArchivearXiv CS
arXiv CSopen access

PERFOPT-Bench: Evaluating Coding Agents on Software Performance Optimization

Unknown · 2026 · arxiv_cs
arXiv CS · Papers · License: Open Access · 2026
Open Source ↗Direct PDF ↓
softwarearchitecturesoftwareengineeringtesting
software engineering, software architecture, testing

PERFOPT-Bench: Evaluating Coding Agents on Software Performance Optimization Yingyun Cui * OPPO Research Institute [email protected]

Yi Xie * University of Arizona [email protected]

Piaohong Wang * OPPO Research Institute [email protected]

Jiawei Ma† Department of Computer Science & Institute of Digital Medicine, City University of Hong Kong [email protected]

Bo Liu† University of Arizona [email protected]

Liangliang Cao† The Hong Kong Polytechnic University [email protected]

Abstract

arXiv:2607.07744v1 [cs.SE] 8 Jul 2026

Coding-agent benchmarks have largely measured whether agents can produce functionally correct patches, but production software also demands measurable speedups on real execution targets. Performance optimization is a distinct agentic task: agents must profile executions, diagnose cross-layer bottlenecks, edit code without breaking correctness, and verify that gains are reproducible rather than measurement artifacts. We introduce PERFOPTBench, a benchmark for evaluating this full performance-engineering loop. Each task provides a correct but deliberately suboptimal codebase and asks the agent to improve a target performance metric; scoring requires hidden correctness tests, verified-speedup measurement, and trajectory-level audit. We evaluate 7 agent stacks with different LLMs and agent frameworks on 12 long-horizon optimization tasks. The results show that optimization performance is workload-dependent rather than determined by model identity alone: no single stack dominates, and changing the agent framework can materially change the same LLM’s per-task speedup profile. We further find that raw speedup is unsafe as a benchmark score, since some large gains arise from benchmarkspecific shortcut exploitation; an exploratory relay pilot suggests that restarting from an externalized optimization summary can recover additional headroom after an initial session stops. The benchmark and our evaluation are available at: https://anonymous.4open.science/r/ Dataset-D3CC.

1

Introduction

Coding agents increasingly operate as autonomous developers: inspecting files, executing tests, and revising code based on feedback (Jimenez et al., 2024; Yang et al., 2024; Wang et al., 2025; Merrill * Equal contribution. †

All these authors are corresponding authors.

et al., 2026). Benchmarks have followed this shift, moving from function-level synthesis (Chen et al., 2021; Austin et al., 2021) to repository repair and terminal environments (Jimenez et al., 2024; Jain et al., 2024; Zhuo et al., 2025; Merrill et al., 2026). Yet most evaluations still credit agents for passing tests or resolving issues, leaving performance largely outside the scoring target. This omission matters in production settings, where code must remain efficient and stable across hardware, runtime environments, and resource constraints (Williams et al., 2009; Nickolls et al., 2008; Dean and Barroso, 2013). Software performance tuning differs fundamentally from writing a passing patch. Source-code inspection alone is insufficient; agents must profile real executions, diagnose system-level bottlenecks, and account for platform dependence. A change that accelerates one architecture can slow another, so the central evaluation question shifts from Can the agent produce correct code? to Can it measurably optimize a system on the target hardware? This shift surfaces challenges that single-shot code generation does not. An agent must (i) design and run a profile–patch–verify inner loop without external scaffolding; (ii) hold the optimization objective steady across very long execution trajectories; (iii) organize and compress measurement history when reasoning spans multiple context windows; and (iv) carry enough systems knowledge to recover from diverse failure modes such as bottleneck misidentification, ineffective micro-optimization, correctness regression, and unstable measurement. Prior work covers parts of this picture – algorithmic optimization (Shypula et al., 2024), resourceefficient generation (Du et al., 2024; Huang et al., 2024), repository performance repair (He et al., 2025; Ma et al., 2025), and GPU operator synthesis (Ouyang et al., 2025; Li et al., 2025) – but none

require an agent to complete the full performanceengineering loop autonomously: navigating a codebase, profiling the target hardware, modifying implementations without breaking correctness, and empirically validating the gains. We introduce PERFOPT-Bench to evaluate that loop directly. Each task pairs a functionally correct but suboptimal codebase with a natural-language optimization objective. Agents must improve a target metric without breaking correctness, while interacting with the system through profiling, editing, and empirical feedback. On this benchmark, we evaluate 7 agent stacks across 12 long-horizon tasks. We find that optimization capability is workload-dependent and not a property of the LLM alone: the best stack changes across tasks, and agent frameworks shape the same LLM’s per-task speedup profile. We also find that agent relay may expose additional optimization headroom. Our contributions are threefold: • PERFOPT-Bench, a cross-layer software performance optimization benchmark with verified speedup metrics and hidden correctness checks, covering a wide range of optimization problems, including toolchain configuration, SIMD usage, memory locality, cache behavior, and algorithmic restructuring. • A semi-automated construction pipeline that separates task authoring from evaluated agents, combining LLM-driven category generation, private reference solving, pilot-solver calibration, and expert curation to produce diverse performanceoptimization tasks. • An empirical study of seven agent stacks on twelve tasks, showing that optimization performance is workload-dependent, so that agent frameworks can materially change the behavior of the same LLM, and that—because performance is environment-conditioned—raw speedups must be read case-by-case and validated by combined executable checks and expert audit rather than by passing tests alone; we additionally report an exploratory one-step relay pilot as a continuation stress test.

2

Benchmark Construction

PERFOPT-Bench is organized around cross-layer bottlenecks rather than isolated algorithmic puzzles. In mature software, remaining speedups often come from better alignment between the implementation, toolchain, runtime, workload, and hardware

architecture. We therefore construct optimization opportunities around four recurring families: • Build/toolchain configuration – compiler flags, feature macros, target-specific options, and SIMD dispatch paths. • Scalar compute and missing vectorization – FPintensive kernels that remain scalar or fail to expose SIMD-friendly structure. • Memory access and cache locality – pointer chasing, indirect gathers, poor layout, and cacheunfriendly traversal. • Parallelism and runtime dispatch overhead – missing thread-level parallelism or overhead from OpenMP scheduling, virtual calls, function pointers, and runtime dispatch. Considering these optimization problems, we built a semi-automated pipeline with four stages to construct PERFOPT-Bench. Figure 1 illustrates the pipeline with LLM-driven generation, adversarial shaping, and expert curation. The first three stages are automated; only stage 4 places a human in the loop. The details of these four stages are described in the Appendix.

3

Experiments

3.1

Evaluation Protocol, Metrics, and Tools

Settings. We evaluate 7 agent stacks, each defined by one LLM backbone and one codingagent framework. The stacks span Claude Code, OpenCode, and Codex, and five LLMs: GLM5.1 (Z.AI, 2026), GPT-5.5 (OpenAI, 2026), Opus4.7 (Anthropic, 2026), Kimi-K2.6 (Kimi, 2026), and DeepSeek-V4 Pro (DeepSeek, 2026). Rather than a full Cartesian product, the design supports same-LLM cross-framework comparisons (GPT-5.5 in OpenCode/Codex; Opus-4.7 in OpenCode/Claude Code) and same-framework crossLLM comparisons in OpenCode, giving stacks codex-gpt, oc-gpt, cc-opus, oc-opus, oc-glm, oc-kimi, and oc-dsv4. We use each LLM’s maximum supported thinking effort setting. Because raw speedup can reflect benchmark-specific shortcuts rather than genuine optimization, candidate shortcuts are first flagged by an automated screen and then judged by combining executable evidence—hidden correctness tests, measurement logs, and trajectory/code inspection—with expert judgment for borderline cases. Neither automated checks nor expert intuition alone suffices, because shortcut judgment for performance tasks is inherently ambiguous and workload-dependent: a

Table 1: Comparison with related coding-agent and performance benchmarks. PERFOPT-Bench targets the intersection of these eight dimensions; abbreviations are defined below. Perf. Cross- Cont. Real Bottleneck Auto- Real Opt. Layer Score HW Dx Gen. Repo Agentic

Benchmark

Task type

Function / algorithm level HumanEval(Chen et al., 2021) LiveCodeBench(Jain et al., 2024) BigCodeBench(Zhuo et al., 2025)

Function generation Competition programming API-call generation

✗ ✗ ✗

✗ ✗ ✗

✗ ✗ ✗

✗ ✗ ✗

✗ ✗ ✗

✗ △ ✗

✗ ✗ ✗

✗ ✗ ✗

Repository / engineering level SWE-bench(Jimenez et al., 2024) FeatureBench(Zhou et al., 2026) AutoCodeBench(Chou et al., 2025)

Bug fixing Feature development Generated coding tasks

✗ ✗ ✗

✗ ✗ ✗

✗ ✗ ✗

✗ ✗ ✗

△ ✗ ✗

✗ △ ✓

✓ ✓ ✗

✗ ✗ ✗

Agent / terminal environments Terminal-Bench(Merrill et al., 2026) τ -bench(Yao et al., 2024) RE-bench(Wijk et al., 2025) TheAgentCompany(Xu et al., 2024)

Terminal operations Tool use ML research tasks Enterprise tasks

✗ ✗ ✗ ✗

✗ ✗ △ ✗

✗ ✗ ✓ ✓

✗ ✗ ✓ ✗

✗ ✗ △ ✗

✗ ✗ ✗ ✗

✗ ✗ ✗ ✗

✓ ✓ ✓ ✓

Code efficiency / performance PIE(Shypula et al., 2024) SWE-Perf(He et al., 2025)

Performance editing Repository performance repair

△ ✓

✗ ✗

✓ ✓

✗ ✗

✗ △

✗ ✗

✗ ✓

✗ ✗

GPU kernel generation KernelBench(Ouyang et al., 2025) PyTorch-to-CUDA kernels Robust-KBench(Lange et al., 2025) Kernel stress tests TritonBench(Li et al., 2025) Triton operator generation MobileKernelBench(Zou et al., 2026) Mobile kernels

✓ ✓ ✓ ✓

△ △ △ △

✓ ✓ ✓ ✓

✓ ✓ ✓ ✓

✗ ✗ ✗ ✗

✗ ✗ ✗ ✗

✗ ✗ △ ✗

✗ ✗ ✗ ✗

PERFOPT-Bench

System performance optimization

✓ = fully, △ = partially or task-subset dependent, ✗ = not satisfied. Perf. Opt.: performance is scored; Cross-Layer: optimization depends on compiler, runtime, workload, memory hierarchy, or hardware behavior; Cont. Score: graded (not pass/fail); Real HW: runs on physical target hardware; Bottleneck Dx: solving requires bottleneck identification; Auto-Gen.: tasks auto-generated; Real Repo: repository-scale code; Agentic: solver interacts with files/commands/tools.

Stage 1: Direction Decomposition

Stage 2: Test Case Generation

Stage 3: Difficulty Stage 4: Expert Calibration & → Curation & Threshold Adversarial Hardening Refinement

Figure 1: Benchmark pipeline with LLM-driven generation, adversarial shaping, and expert curation.

change that is a valid specialization on one workload can be a benchmark shortcut on another. Raw shortcut outputs are discarded and the affected cells are re-evaluated under a hardened task contract, retaining only a re-verified valid result; a cell stays blank in Figure 2 only when no valid result remains. Single-run numbers should therefore be read with caution rather than as absolute values. Each run receives the same issue.md and paths to Code/ and Solution/. Agents do not see the reference implementation, hidden evaluator, or hidden validation inputs. We add no extra hints beyond each framework’s default system prompt. The primary metric is verified speedup: baseline runtime divided by submitted runtime, reported after hidden correctness tests; suspicious or outlier cells additionally undergo expert trajectory audit. Unlike functional-correctness benchmarks, passing hidden tests is not sufficient here: a submission can preserve outputs yet exploit workload-, measurement, or environment-specific artifacts. We therefore

treat each speedup as an environment-conditioned claim and read it case by case—under its task workload, hardware, compiler/runtime stack, and audit status—rather than as an entry in a universal LLM leaderboard. Figure 2 reports verified pertask speedups. We report single-run profiles, which are descriptive snapshots rather than statistically stable rankings. 3.2

Workload-Dependent Stack Performance

We first ask whether one agent stack consistently leads across cross-layer performance optimization tasks. Figure 2 answers this question with verified per-task speedup profiles for all seven stacks. Rather than forming a stable global ordering, the per-task winners change across columns (the starred cells), peak on different workloads, and leave different numbers of cells unverified. Observation 1. No single agent stack dominates across models and tasks. The best-performing stack depends on the workload: the strongest aggregate profile is not the same as the stack that wins the most individual tasks.

Table 2: Best-of-N leaderboard over the 12 tasks (full per-task matrix in Figure 2). Each task’s top stack earns one credit (ties split equally; N =7 stacks compete); GeoMean is over each stack’s valid tasks. Agent Configuration OpenCode + GPT-5.5 [xhigh] Codex + GPT-5.5 [xhigh] OpenCode + Opus-4.7 [max] Claude Code + Opus-4.7 [max] OpenCode + GLM-5.1 OpenCode + Kimi-K2.6 OpenCode + DeepSeek-V4 Pro [max]

Best-of-N GeoMean 4 4 2.5 1.5 0 0 0

9.2× 8.2× 7.4× 6.7× 9.9× 5.7× 3.1×

Table 2 summarizes the divergence: no stack wins more than four of the twelve tasks. The highest valid-cell geometric mean, oc-glm at 9.9× (over its 10 valid tasks, so not directly comparable across stacks), comes from a stack that wins zero tasks, whereas oc-gpt and codex-gpt take the most wins (four each). The remaining stacks are broader but more moderate, rarely reaching the top GPT/Opus peaks.

3.3

Framework Effects Under a Fixed LLM

Public coding-agent comparisons often rank agent stacks by the underlying LLM. For performance tuning, this is incomplete: the agent framework shapes how the LLM plans, invokes tools, inspects files, runs experiments, and decides when to stop. Table 3 and Table 4 compare the performance of different agent stacks. Observation 2. Agent frameworks are optimization components, not interchangeable wrappers. Holding the LLM fixed can change the verified speedup profile, so performance should be attributed to the complete agent stack rather than to the LLM alone.

The GPT contrast illustrates the effect most clearly. With the same GPT-5.5 LLM, the agent framework reshapes both the aggregate and the per-task profile: oc-gpt attains a higher geometric mean on shared cells (9.2× vs. 7.8×) and wins more task-level comparisons (7 vs. 4) than codex-gpt, yet codex-gpt still leads on specific workloads such as T2, T3, T6, and T10. The Opus contrast is smaller in aggregate, but it again shows the same LLM producing different speedup profiles under OpenCode and Claude Code. These contrasts support evaluating the complete agent stack rather than reporting the LLM name alone.

3.4

Unexpected Shortcut Exploitation in Speedup Evaluation

Every agent stack received the same task description and verification scripts, so a speedup should reflect a faster, semantically equivalent implementation. After the first round, however, a few stacks produced raw, pre-audit speedups far larger than any verified result we report—outliers hard to explain through normal optimization. We audited these extreme cases to ask how the agent obtained such a large speedup. Manual trajectory inspection showed that some high-speedup solutions were not ordinary crosslayer performance optimizations (Table 7 in the Appendix lists the audited cases). In one representative case, the agent did not directly modify the final validation-test code. Instead, it carefully analyzed how the benchmark validator exercised the program, inferred benchmark-specific structure from that procedure, and then changed the source code to fit those validation conditions. The result was a program that performed extremely well under the measured benchmark path, but whose improvement was tied to the evaluator rather than to a broadly faster implementation. This is subtle because it resembles profile-guided optimization (PGO): a developer may study profiles and workloads and specialize for the observed regime. The problematic step here is that the agent treats the benchmark’s input distribution, validation procedure, or expected outputs as part of the solution, solving the benchmark instance rather than the intended class of problems—so we call it benchmark-specific shortcut exploitation rather than standard PGO. Observation 3. Reward-hacking-like shortcuts expose the boundary between valid specialization and benchmark exploitation. In optimization benchmarks, a capable agent stack may discover evaluator-specific strategies that increase measured speedup without providing a general cross-layer performance optimization. Such behavior can signal strong search and boundary probing, but benchmark scores should count it only when the resulting method remains effective under changed workloads or validation data.

This boundary is genuinely case-by-case: specialization to a fixed deployment workload can be sound engineering, so a benchmark must decide whether it measures performance on one concrete workload or general optimization ability across a family of workloads. Our mitigation is to make the intended generalization requirement explicit in the task description and in the verification procedure. The opti-

Table 3: Framework comparison on Opus-4.7 [max]: OpenCode vs. Claude Code. Per-task speedup (×); “–” excluded from computation. The higher value in each row is bolded. Task

OpenCode + Opus-4.7 [max]

Claude Code + Opus-4.7 [max]

Winner

T1_build_perf T2_math_dispatch T3_data_engine T4_image_processing T5_data_engine T6_query_engine T7_index_scanner T8_ml_runtime T9_climate_model T10_sparse_solver T11_text_processor T12_graph_traversal

1.280 8.033 1.684 4.311 16.003 12.575 6.749 4.993 15.931 12.283 23.472 12.506

1.220 6.500 1.243 10.688 23.196 11.060 10.695 12.981 15.931 9.199 1.037 13.618

OpenCode OpenCode OpenCode Claude Code Claude Code OpenCode Claude Code Claude Code Tie OpenCode OpenCode Claude Code

GeoMean Wins

7.4× 6

6.7× 5

OpenCode (1 tie)

Table 4: Framework comparison on GPT-5.5 [xhigh]: OpenCode vs. Codex. Per-task speedup (×); “–” excluded from computation. GeoMeans are over the 11 tasks both stacks completed (T9 excluded: OpenCode+GPT produced no valid result). The higher value in each row is bolded. Task T1_build_perf T2_math_dispatch T3_data_engine T4_image_processing T5_data_engine T6_query_engine T7_index_scanner T8_ml_runtime T9_climate_model T10_sparse_solver T11_text_processor T12_graph_traversal GeoMean Wins

OpenCode + GPT-5.5 [xhigh]

Codex + GPT-5.5 [xhigh]

Winner

1.211 13.501 2.022 12.407 11.149 14.099 21.111 13.154 – 12.146 11.857 15.852

1.119 15.292 2.286 10.352 2.967 17.531 14.519 11.450 14.918 13.100 10.272 13.477

OpenCode Codex Codex OpenCode OpenCode Codex OpenCode OpenCode – Codex OpenCode OpenCode

9.2× (11 shared) 7

7.8× (11 shared) 4

OpenCode (T9 excluded)

mized program should not depend on a particular visible workload, hard-coded output pattern, or measurement-facing artifact. If the benchmark contents or hidden validation data are replaced by equivalent instances, the same optimization idea should retain similar performance benefits.

anticipate. The open problem is thus not merely detecting “cheating,” but specifying when specialization is acceptable and how benchmarks should score stacks that can surface both a shortcut and a general optimization.

The LLM-level pattern, measured through complete agent stacks, also affects how we interpret reward hacking. Among the trajectories we manually inspected, shortcut behavior was observed most frequently and was easiest to verify in GPT-5.5based stacks, but it was not exclusive to them: a Kimi-K2.6 stack independently produced the same answer-synthesis shortcut as a GPT stack on the sparse-solver task, whereas the GLM-5.1 and DeepSeek-V4 Pro trajectories we examined showed no comparable evidence. We report this as a qualitative observation from a limited audit rather than as a measured rate. We do not read this only as a failure mode: a capable stack may simply search more aggressively near the task boundary and find high-reward paths the designer did not

3.5

Agent Relay for Optimization Continuation

Following the terminology in Section 3.1, an agent stack pairs an LLM with an agent framework; in deployment, the stack also includes its tool interface and execution policy. After an initial run, the active stack writes a relay document using a common schema: task objective, attempted edits and commands, measured outcomes, useful and ineffective changes, and remaining optimization hypotheses. A fresh second session then starts from the R1-modified workspace plus this relay document. Self-relay keeps the same agent stack for the second session, whereas cross-stack relay switches to the other stack.

Task Mode T5 T5 T5 T5 T8 T8 T8 T8

Relay sequence

R1

R2 R2/R1

cross-stack codex-gpt→cc-opus 1.57 3.90 cross-stack cc-opus→codex-gpt 1.65 2.22 self-relay codex-gpt→codex-gpt 1.80 2.07 self-relay cc-opus→cc-opus 2.39 3.29 cross-stack codex-gpt→cc-opus 10.76 15.28 cross-stack cc-opus→codex-gpt 10.39 10.57 self-relay codex-gpt→codex-gpt 7.78 9.34 self-relay cc-opus→cc-opus 9.60 17.14

2.48 1.35 1.15 1.38 1.42 1.02 1.20 1.79

Table 5: Two-round relay pilot using complete agentstack names from Section 3.1. Each row is an independent sequence: the left stack runs first, writes a relay document, and the right stack starts a fresh second session from the R1-modified workspace plus that document. Self-relay repeats the same stack, while cross-stack relay switches stacks. R1 and R2 are verified speedups (×) within each task.

Protocol and scope. We run a budgetconstrained two-case pilot on PERFOPT-Bench Task 5 and Task 8 using two representative agent stacks from Section 3.1: codex-gpt and cc-opus. We use these stack names throughout the relay study. The two tasks were chosen as contrasting cases from the single-run profiles in Figure 2, before interpreting relay outcomes: on T8 the two stacks have comparable single-run speedup, which limits the initial capability gap, whereas on T5 their single-run results differ. We therefore treat T5 as a within-sequence continuation case rather than a matched cross-stack comparison. Each row in Table 5 is an independent two-round sequence; therefore R1 scores may differ even when the same task and initial stack appear in multiple rows. The pilot probes whether one additional fresh session can recover optimization headroom after an initial session stops. Observation 4. One-step relay recovers additional headroom in the tested sequences. In all eight tested two-round sequences, R2 improves over the corresponding independent R1 score, with relative gains of 1.02–2.48×. This is consistent with the idea that externalizing intermediate optimization state and restarting a fresh session can extend the search after the first session stops. Because this limited pilot adds budget and lacks no-document, longersession, and clean-workspace controls, we treat it as evidence for relay as a continuation pattern, rather than as proof that relay documents or stack switching cause the gains.

Table 5 provides the supporting R1-to-R2 results. The architectural takeaway is that an agent system can externalize intermediate optimization evidence and start a fresh session to continue the search after the initial run stops. We frame this as exploratory system-design evidence, not a final benchmark conclusion; future work should broaden task cover-

age and add equal-budget controls (longer single sessions, restarts without the relay document, and clean-workspace restarts).

4

Conclusion

We introduced PERFOPT-Bench, a benchmark for evaluating coding agents on verified software performance optimization rather than functional correctness alone. Evaluation across seven agent stacks and twelve tasks shows that no single stack consistently dominates, and that agent frameworks can substantially change the per-task speedup profile of the same LLM, even when aggregate means stay close. Our results show that raw speedup is an unreliable benchmark metric, as large gains may arise from measurement artifacts, workload shortcuts, or visible-test overfitting. PERFOPT-Bench therefore treats speedup as a claim requiring correctness checks and expert verification. The relay pilot further suggests that additional optimization rounds may unlock further gains. PERFOPT-Bench provides a step toward evaluating coding agents as performance-engineering systems.

Limitations PERFOPT-Bench targets software performance optimization rather than general coding ability, so its results should not be read as a universal leaderboard for code generation. Our study is also limited in scale and coverage: we evaluate seven agent stacks on twelve representative tasks chosen for controlled contrasts. Reported speedups remain dependent on hardware, compiler versions, runtime libraries, and benchmark inputs. Although hidden tests and trajectory audits reduce invalid claims, they cannot eliminate all measurement artifacts or subtle cheating risks. In addition, due to time and budget constraints, each model–framework–task cell was measured with a single run rather than repeated samples. Because performance speedup is a continuous, noisy quantity rather than a binary pass/fail outcome, these single-run numbers are indicative rather than statistically precise; multiple samples per cell, with variance and significance, are left to future work. Our shortcut audit was also not exhaustive: suspicious cases were reviewed by a single performance expert, so some borderline cases may remain subject to interpretation. Finally, the relay study is exploratory and budget-confounded.

References Anthropic. 2026. Claude Opus 4.7. https://www. anthropic.com/news/claude-opus-4-7. Jacob Austin, Augustus Odena, Maxwell Nye, Maarten Bosma, Henryk Michalewski, David Dohan, Ellen Jiang, Carrie Cai, Michael Terry, Quoc Le, and Charles Sutton. 2021. Program synthesis with large language models. arXiv preprint arXiv:2108.07732. Mark Chen, Jerry Tworek, Heewoo Jun, Qiming Yuan, Henrique Ponde de Oliveira Pinto, Jared Kaplan, Harri Edwards, Yuri Burda, Nicholas Joseph, Greg Brockman, and 1 others. 2021. Evaluating large language models trained on code. arXiv preprint arXiv:2107.03374. Jason Chou, Ao Liu, Yuchi Deng, Zhiying Zeng, Tao Zhang, Haotian Zhu, Jianwei Cai, Yue Mao, Chenchen Zhang, Lingyun Tan, Ziyan Xu, Bohui Zhai, Hengyi Liu, Speed Zhu, Wiggin Zhou, and Fengzong Lian. 2025. Autocodebench: Large language models are automatic code benchmark generators. CoRR, abs/2508.09101. Jeffrey Dean and Luiz André Barroso. 2013. The tail at scale. Communications of the ACM, 56(2):74–80. DeepSeek. 2026. DeepSeek-V4-Pro. https://huggingface.co/deepseek-ai/ DeepSeek-V4-Pro. Mingzhe Du, Anh Tuan Luu, Bin Ji, Qian Liu, and See-Kiong Ng. 2024. Mercury: A code efficiency benchmark for code large language models. In Advances in Neural Information Processing Systems. Xinyi He, Qian Liu, Mingzhe Du, Lin Yan, Zhijie Fan, Yiming Huang, Zejian Yuan, and Zejun Ma. 2025. SWE-perf: Can language models optimize code performance on real-world repositories? arXiv preprint arXiv:2507.12415. Dong Huang, Yuhao Qing, Weiyi Shang, Heming Cui, and Jie M. Zhang. 2024. EffiBench: Benchmarking the efficiency of automatically generated code. In Advances in Neural Information Processing Systems. Naman Jain, King Han, Alex Gu, Wen-Ding Li, Fanjia Yan, Tianjun Zhang, Sida Wang, Armando SolarLezama, Koushik Sen, and Ion Stoica. 2024. LiveCodeBench: Holistic and contamination free evaluation of large language models for code. arXiv preprint arXiv:2403.07974. Carlos E. Jimenez, John Yang, Alexander Wettig, Shunyu Yao, Kexin Pei, Ofir Press, and Karthik Narasimhan. 2024. SWE-bench: Can language models resolve real-world GitHub issues? In International Conference on Learning Representations. Kimi. 2026. K2.6: From Code to Creation, From One to Many. https://www.kimi.com/ai-models/ kimi-k2-6.

Robert Tjarko Lange, Qi Sun, Aaditya Prasad, Maxence Faldor, Yujin Tang, and David Ha. 2025. Towards robust agentic CUDA kernel benchmarking, verification, and optimization. CoRR, abs/2509.14279. Jianling Li, Shangzhan Li, Zhenye Gao, Qi Shi, Yuxuan Li, Zefan Wang, Jiacheng Huang, Haojie Wang, Jianrong Wang, Xu Han, Zhiyuan Liu, and Maosong Sun. 2025. TritonBench: Benchmarking large language model capabilities for generating triton operators. In Findings of the Association for Computational Linguistics: ACL, pages 23053–23066. Jeffrey Jian Ma, Milad Hashemi, Amir Yazdanbakhsh, Kevin Swersky, Ofir Press, Enhui Li, Vijay Janapa Reddi, and Parthasarathy Ranganathan. 2025. SWEfficiency: Can language models optimize real-world repositories on real workloads? arXiv preprint arXiv:2511.06090. Mike A. Merrill, Alexander G. Shaw, Nicholas Carlini, Boxuan Li, Harsh Raj, Ivan Bercovich, Lin Shi, and 1 others. 2026. Terminal-bench: Benchmarking agents on hard, realistic tasks in command line interfaces. In International Conference on Learning Representations. John Nickolls, Ian Buck, Michael Garland, and Kevin Skadron. 2008. Scalable parallel programming with CUDA. Queue, 6(2):40–53. OpenAI. 2026. GPT-5.5. https://developers. openai.com/api/docs/models/gpt-5.5. Anne Ouyang, Simon Guo, Simran Arora, Alex L. Zhang, William Hu, Christopher Ré, and Azalia Mirhoseini. 2025. KernelBench: Can LLMs write efficient GPU kernels? In International Conference on Machine Learning. Alexander Shypula, Aman Madaan, Yimeng Zeng, Uri Alon, Jacob Gardner, Milad Hashemi, Graham Neubig, Parthasarathy Ranganathan, Osbert Bastani, and Amir Yazdanbakhsh. 2024. Learning performanceimproving code edits. In International Conference on Learning Representations. Xingyao Wang, Boxuan Li, Yufan Song, Frank F. Xu, Xiangru Tang, Mingchen Zhuge, Jiayi Pan, Yueqi Song, Bowen Li, Jaskirat Singh, and 1 others. 2025. OpenHands: An open platform for AI software developers as generalist agents. In International Conference on Learning Representations. Hjalmar Wijk, Tao Roa Lin, Joel Becker, Sami Jawhar, Neev Parikh, Thomas Broadley, Lawrence Chan, Michael Chen, Joshua Clymer, Jai Dhyani, Elena Ericheva, Katharyn Garcia, Brian Goodrich, Nikola Jurkovic, Megan Kinniment, Aron Lajko, Seraphina Nix, Lucas Jun Koba Sato, William Saunders, and 3 others. 2025. Re-bench: Evaluating frontier AI r&d capabilities of language model agents against human experts. In Forty-second International Conference on Machine Learning, ICML 2025, Vancouver, BC, Canada, July 13-19, 2025, Proceedings of Machine Learning Research. PMLR / OpenReview.net.

Samuel Williams, Andrew Waterman, and David Patterson. 2009. Roofline: An insightful visual performance model for multicore architectures. Communications of the ACM, 52(4):65–76.

A.1

More Experiment Results

A.2

Benchmark Task Package

A.2.1

Task Package Layout

Frank F. Xu, Yufan Song, Boxuan Li, Yuxuan Tang, Kritanjali Jain, Mengxue Bao, Zora Zhiruo Wang, Xuhui Zhou, Zhitong Guo, Murong Cao, Mingyang Yang, Hao Yang Lu, Amaad Martin, Zhe Su, Leander Maben, Raj Mehta, Wayne Chi, Lawrence Keunho Jang, Yiqing Xie, and 2 others. 2024. Theagentcompany: Benchmarking LLM agents on consequential real world tasks. CoRR, abs/2412.14161.

Each PERFOPT-Bench task contains an agentvisible workspace and hidden evaluation assets. The visible side includes issue.md, a functionally correct but deliberately suboptimal Code/ directory, and an initially empty Solution/ directory for the agent’s edits. The prompt states the optimization objective and metric, but hides the intended strategy, reference implementation, validation inputs, and target speedup. A hidden evaluator then compiles the baseline and submission, checks correctness, and measures repeated speedup, preserving the boundary between agent-visible optimization evidence and evaluator-only scoring.

John Yang, Carlos E. Jimenez, Alexander Wettig, Kilian Lieret, Shunyu Yao, Karthik R. Narasimhan, and Ofir Press. 2024. SWE-agent: Agent-computer interfaces enable automated software engineering. In Advances in Neural Information Processing Systems. Shunyu Yao, Noah Shinn, Pedram Razavi, and Karthik Narasimhan. 2024. Tau-bench: A Benchmark for Tool-Agent-User Interaction in Real-World Domains. https://arxiv.org/abs/2406.12045. Z.AI. 2026. GLM-5.1. https://docs.z.ai/guides/ llm/glm-5.1. Qixing Zhou, Jiacheng Zhang, Haiyang Wang, Rui Hao, Jiahe Wang, Minghao Han, Yuxue Yang, Shuzhe Wu, Feiyang Pan, Lue Fan, Dandan Tu, and Zhaoxiang Zhang. 2026. Featurebench: Benchmarking agentic coding for complex feature development. CoRR, abs/2602.10975. Terry Yue Zhuo, Minh Chien Vu, Jenny Chim, Han Hu, Wenhao Yu, Ratnadira Widyasari, Imam Nur Bani Yusuf, Haolan Zhan, Junda He, Indraneil Paul, and 1 others. 2025. BigCodeBench: Benchmarking code generation with diverse function calls and complex instructions. In International Conference on Learning Representations. Xingze Zou, Jing Wang, Yuhua Zheng, Xueyi Chen, Haolei Bai, Lingcheng Kong, Syed A. R. AbuBakar, Zhaode Wang, Chengfei Lv, Haoji Hu, and Huan Wang. 2026. Mobilekernelbench: Can llms write efficient kernels for mobile devices? CoRR, abs/2603.11935.

A

Supplementary Protocol Details

Framework client versions. For reproducibility, we record the agent-framework client versions current during our evaluation window (early May 2026): Claude Code 2.1.126, Codex CLI 0.133.0, and OpenCode v1.14.31, on a single target machine (an Intel Core i7 CPU running Windows 11). Because reported speedups depend on these client versions, the model snapshots listed in Section 3.1, and this hardware, they should be read as a snapshot that may shift as these components are updated.

A.3 A.3.1

Prompts and Reporting Artifacts Autonomous Task Execution Prompt

This prompt operationalizes the shared execution setup described in Section 3.1, including autonomous environment setup, validation, and final result reporting. Execution Prompt Task Requirements: Execute the tasks described in issue.md. First, check whether the current machine satisfies the required execution environment. If the environment is not properly configured, automatically install or configure all necessary dependencies before continuing. The entire process should proceed autonomously without interruption or waiting for additional user input. All decisions regarding environment setup, dependency management, and optimization should be made independently. During optimization and validation, use test.ps1 for verification. After completing the task, execute test.ps1 again and include the final execution results in the output report. Use the local system time instead of UTC time. Save the final test results into the current test case directory using the following filename format: {test_case_name}_{start_time}_{end_time}_test_result.md

Finally, the test program must always be executed to report the final result.

A.3.2

Cheating Detection and Prevention Prompts

These prompts support the shortcut audit and mitigation discussion in Section 3.4. The first prompt asks an independent reviewer to detect invalid shortcuts after an optimization attempt, while the second prompt rewrites task descriptions with an explicit anti-cheating contract before evaluation.

Table 6: Model comparison under the OpenCode framework. Per-task speedup (×) across 12 P ERF O PT-B ENCH tasks; “–” denotes a result that was either invalid or discarded as shortcut exploitation, and is excluded from all computations. The highest value per task is bolded.

Task

Opus-4.7 [max]

GPT-5.5 [xhigh]

DeepSeek-V4 Pro [max]

Kimi-K2.6 –

GLM-5.1 –

T1_build_perf T2_math_dispatch T3_data_engine T4_image_processing T5_data_engine T6_query_engine T7_index_scanner T8_ml_runtime T9_climate_model T10_sparse_solver T11_text_processor T12_graph_traversal

1.280 8.033 1.684 4.311 16.003 12.575 6.749 4.993 15.931 12.283 23.472 12.506

1.211 13.501 2.022 12.407 11.149 14.099 21.111 13.154 – 12.146 11.857 15.852

1.092 2.335 1.016 3.764 6.500 2.857 5.927 4.990 6.660 1.770 1.148 11.081

1.157 5.824 1.247 3.490 12.709 11.300 10.600 12.249 13.259 0.990 12.659 14.287

– 10.389 – 11.028 13.145 13.145 11.814 11.101 11.222 2.800 10.098 10.946

GeoMean Valid Tasks

7.4× 12

9.2× 11

3.1× 12

5.7× 12

9.9× 10

T1 Build

T2 Math

T3 Data

T4 Image

T5 Data

T6 Query

T7 Index

T8 ML

T9 Climate

T10 Sparse

T11 Text

T12 Graph

oc-opus 3 wins

1.3

8.0

1.7

4.3

16.0

12.6

6.7

5.0

15.9

12.3

23.5

12.5

cc-opus 1 wins

1.2

6.5

1.2

10.7

23.2

11.1

10.7

13.0

15.9

9.2

1.0

13.6

oc-gpt 4 wins

1.2

13.5

2.0

12.4

11.1

14.1

21.1

13.2

12.1

11.9

15.9

codex-gpt 4 wins

1.1

15.3

2.3

10.4

3.0

17.5

14.5

11.4

14.9

13.1

10.3

13.5

oc-dsv4 0 wins

1.1

2.3

1.0

3.8

6.5

2.9

5.9

5.0

6.7

1.8

1.1

11.1

oc-kimi 0 wins

1.2

5.8

1.2

3.5

12.7

11.3

10.6

12.2

13.3

1.0

12.7

14.3

11.0

13.1

13.1

11.8

11.1

11.2

2.8

10.1

10.9

80 70

50 40

Speedup (×)

Agent stack

60

30 20

10

oc-glm 0 wins

10.4

Cell values denote speedup (×) over baseline; marks per-task best; hatched = missing.

Figure 2: Cell values denote speedup (×) over baseline; stars mark per-task best; hatched = missing (no valid result or discarded shortcut case). Cheating Detection Prompt Role: You are an anti-cheat reviewer. Audit whether this change truly satisfies the task contract, rather than passing through hard-coding, test bypasses, fabricated metrics, or specialization to public examples. Please check whether the submission: 1. Modifies or bypasses tests, evaluation scripts, readonly files, entry points, or public APIs. 2. Hard-codes public inputs, answers, hashes, outputs, timing values, random seeds, sizes, paths, or call counts. 3. Intercepts or redefines standard libraries, timing functions, random number generation, IO, networking, test frameworks, or system APIs. 4. Reduces the real workload, shrinks workload sizes, relaxes validation, or fabricates logs, scores, or

runtimes. 5. Works only on public tests while failing, crashing, or returning placeholder results for other valid inputs. 6. Depends on hidden state such as environment variables, the current directory, machine information, wall-clock time, caches, temporary files, or background processes. Anti-Cheating Task-Description Prompt Revise the task description by adding an explicit anticheating contract. Preserve the original optimization objective, public API, correctness requirements, and build workflow, but add the following constraints: • Treat benchmark.c as a black-box client; do

Table 7: Shortcut cases identified by trajectory audit (Section 3.4). “Raw” is the inflated speedup the shortcut produced (“–” where not logged). After audit, the climate-model case was discarded (blank in Figure 2); the remaining cells were re-evaluated under a shortcut-prevention task contract, and their retained verified speedups are the values shown in Figure 2. Stack

Task

Shortcut mechanism

oc-gpt codex-gpt codex-gpt oc-gpt codex-gpt oc-kimi oc-gpt

T11 text T11 text T1 build T1 build T10 solver T10 solver T9 climate

answer synthesis – 11.9× answer synth. + output tamper – 10.3× semantic bypass – 1.1× semantic bypass 107.9× 1.2× answer synthesis 492.8× 13.1× answer synthesis – 1.0× build-artifact substitution 110× discarded

not analyze, wrap, include, replace, or generate it. • Solution/build.ps1 must compile the original benchmark.c as a normal independent compilation unit; do not rename main or use a wrapper. • Do not hard-code RESULT_HASH, checks, TOTAL_MS, workload sizes, seeds, key formats, or call order. • Do not intercept snprintf, printf, strcmp, strlen, timing functions, or related APIs to observe or tamper with benchmark behavior. • dictFind must return values that were actually inserted; do not derive values from keys. • listNext must traverse elements one by one; do not use aggregate nodes to skip traversal. • State that final evaluation may replace the hidden benchmark and run randomized API semantic-equivalence tests.

A.3.3 One-Step Relay Summary Prompt This prompt is used in the relay continuation protocol described in Section 3.5. After one agent stack stops optimizing, the resulting summary is passed to the next coding agent as relay context so that the second session can continue optimization from the previous attempt. Relay Summary Prompt Summarize the following information: • Your understanding of the task, including where its difficulty lies; • All attempts you have made so far, along with the corresponding outcomes; • The reason why you stopped optimizing. I will send this summary to another coding agent for continued optimization.

Because this workflow can span multiple

Raw Final

sessions and different agent stacks, we used Onward, an Agent First Design terminal tool with a multi-window TUI interface: https:// onward-agent-workbench.github.io/. A.4

Four Stages of Benchmark Construction

Stage 1: Task planning. A task generator – an LLM-driven authoring tool that is held separate from any evaluated agent – starts from a broad goal: cross-layer program optimization under correctness constraints. It expands the goal into more than 180 candidate task categories. Each category is a structured record with five fields: the optimization target, the relevant hardware or runtime behaviour, the measurement method, the pass criterion, and a difficulty tag. A category is a schema, not a single task: stage 2 instantiates each category into one or more concrete task packages. Stage 2: Building task package. For each category, the pipeline produces a candidate task package with two clearly separated parts: an agentvisible workspace and hidden evaluation assets. The task generator drafts issue.md and constructs the baseline Code/ directory by adapting opensource implementations and inserting bottlenecks from the four families described above. A separate reference solver then writes a private optimized implementation; the reference is used only for feasibility checks and threshold setting, is never placed in Solution/, and is never shown to evaluated agents. An evaluation runner finally compiles both versions, checks hidden correctness, and times them on the target hardware. This run produces the initial feasibility verdict and the candidate speedup threshold. Stage 3: Difficulty calibration. A pilot solver attempts each candidate under the same workspace visibility, tool-use constraints, and execution bud-

get as the final evaluation. If a candidate is solved too easily, the task generator strengthens it by adding bottleneck layers, increasing the minimum codebase size, raising the performance threshold, or tightening correctness constraints such as bitexact numerical reproducibility. GPU and NUMA tasks run serially with full resource access; pure CPU tasks run in parallel with cgroup cpuset isolation to avoid interference. The loop continues until the pilot solver’s pass rate over the candidate pool converges to approximately 45%, leaving roughly 28 calibrated tasks in a regime that discriminates between systems without being uniformly unsolvable.

• Realistic: Performance issues are modeled after real-world patterns (cache misses, algorithmic inefficiency, suboptimal data layout, missing SIMD vectorization, etc.).

Stage 4: Expert curation (human-in-the-loop). A senior systems-optimization expert inspects the calibrated candidate pool and selects 12 representative tasks. The final set covers diverse optimization regimes – build-system tuning, dispatch logic, dataengine kernels, query execution, sparse solvers, text processing, and graph traversal. The expert then refines the generated speedup thresholds to align with realistic optimization ceilings while preserving the relative difficulty ordering induced by the calibration loop.

• Cross-platform: Build and test scripts are provided for both Linux and Windows environments.

• Measurable: Each task includes a benchmark driver that quantifies throughput or latency, and a test script that validates both correctness and performance improvement. • Diverse: Tasks span 8 domains including databases, numerical computing, ML runtimes, simulation, text processing, and graph analytics.

B.5

Evaluation Protocol

An agent is given the issue.md and full access to the Code/ directory. The agent must: 1. Diagnose the root cause of the performance issue.

B

Dataset Card

2. Modify the source code to fix the issue.

B.1

Overview

3. Ensure the fix passes the automated test script (test.sh), which checks both correctness (no regression) and performance improvement (meets a predefined speedup threshold).

We introduce PERFOPT-Bench, a benchmark dataset for evaluating LLM-based agents on realworld software performance optimization tasks. The dataset consists of 12 tasks, each containing a self-contained C codebase with deliberately introduced performance issues, an issue description (bug report), and automated test scripts for validation. B.2

Task Summary

B.3

Dataset Structure

Each task directory Task{N}/ follows a consistent layout: issue.md (the performance bug report); a Code/ subtree with sources (src/, include/), a build script (build.ps1), and the benchmark driver (benchmark.c); and automated test scripts test.sh (Linux/macOS) and test.ps1 (Windows). B.4

Task Design Principles

• Self-contained: Each task is a complete, compilable project with no external dependencies beyond a standard C toolchain.

B.6

Statistics

• Total tasks: 12 • Total source files: 272 (C source + headers) • Total lines of code: ∼668K • Median task size: ∼15K LoC • Language: C (compiled with GCC/MSVC) • Domains covered: 8 (Database, Numerical, Data Structures, ML/DL, Storage, Simulation, Text Processing, Graph Analytics) B.7

Licensing and Access

The dataset is publicly available at https:// anonymous.4open.science/r/Dataset-D3CC. All code is provided for research purposes.

Table 8: Summary of PERFOPT-Bench tasks. LoC = lines of C/H code. Each task includes a build script, issue description, and test harness.

C

ID

Domain

System Type

Performance Issue

LoC

1 2 3 4 5 6 7 8 9 10 11 12

Database Numerical Data Structures ML/DL Storage Database Database ML/DL Simulation Linear Algebra Text Processing Graph Analytics

Embedded DB (SQLite) Math/Array processing Hash maps, linked lists Neural network framework Key-value data engine Query engine Columnar index scanner ML runtime Climate/weather model Sparse solver (CG, PCG) Regex engine (Oniguruma) Graph engine

Query performance below expected Below hardware capability Throughput degrades on large data Computation throughput degradation High latency on lookups & scans Inconsistent across dataset sizes Index scan lags sequential scan Matrix ops below theoretical peak Nonlinear scaling with resolution Per-iteration slowdown Slow throughput on workloads Poor cache performance on sparse graphs

300K 113K 11K 37K 27K 15K 16K 15K 15K 15K 92K 12K

Potential Risk

We see no risk to human subjects or sensitive data: all tasks operate on self-contained C codebases adapted from open-source projects. The main residual risks are (i) benchmark gaming, where agents specialize to the released tasks rather than learning general optimization, which we mitigate with hidden correctness tests and trajectory audit; (ii) potential misuse of the documented shortcut techniques, which are standard and already known in the performance-engineering community; and (iii) the compute cost of running long-horizon agentic evaluations.

D

AI Assistants Usage Declaration

We used AI assistants (large language models) to help draft and polish text and to assist in analyzing experimental logs. All experimental design, execution, verification, and final claims are the authors’ responsibility, and the authors reviewed and verified all AI-assisted content.

Record · ID 353129 · SHA-256 974053149a2d802f
Retrieved via Conceptio — every document is proof-bundled with source, license, and retrieval metadata.