PEACE: Towards Efficient Project-Level Efficiency Optimization via Hybrid Code Editing

πŸ“… 2025-10-20
πŸ“ˆ Citations: 0
✨ Influential: 0
πŸ“„ PDF
πŸ€– AI Summary
Existing LLM-based code efficiency optimization methods operate solely at the function level, ignoring inter-procedural dependencies and thus failing to scale to project-level optimization. This work proposes the first project-level hybrid code editing framework: (1) it constructs a dependency-aware optimization sequence via static dependency analysis; (2) it introduces an effective edit correlation identification mechanism to mitigate spurious edits and suboptimal internal function optimizations; and (3) it implements end-to-end automated optimization through a three-stage iterative pipelineβ€”LLM-driven editing, empirical validity verification, and feedback-guided correction. Evaluated on our curated benchmark PeacExec, the framework achieves a 69.2% pass@1 correctness rate, improves optimization success rate by 46.9%, and delivers an average execution speedup of 0.840Γ—, significantly outperforming state-of-the-art approaches.

Technology Category

Application Category

πŸ“ Abstract
Large Language Models (LLMs) have demonstrated significant capability in code generation, but their potential in code efficiency optimization remains underexplored. Previous LLM-based code efficiency optimization approaches exclusively focus on function-level optimization and overlook interaction between functions, failing to generalize to real-world development scenarios. Code editing techniques show great potential for conducting project-level optimization, yet they face challenges associated with invalid edits and suboptimal internal functions. To address these gaps, we propose Peace, a novel hybrid framework for Project-level code Efficiency optimization through Automatic Code Editing, which also ensures the overall correctness and integrity of the project. Peace integrates three key phases: dependency-aware optimizing function sequence construction, valid associated edits identification, and efficiency optimization editing iteration. To rigorously evaluate the effectiveness of Peace, we construct PeacExec, the first benchmark comprising 146 real-world optimization tasks from 47 high-impact GitHub Python projects, along with highly qualified test cases and executable environments. Extensive experiments demonstrate Peace's superiority over the state-of-the-art baselines, achieving a 69.2% correctness rate (pass@1), +46.9% opt rate, and 0.840 speedup in execution efficiency. Notably, our Peace outperforms all baselines by significant margins, particularly in complex optimization tasks with multiple functions. Moreover, extensive experiments are also conducted to validate the contributions of each component in Peace, as well as the rationale and effectiveness of our hybrid framework design.
Problem

Research questions and friction points this paper is trying to address.

Optimizing code efficiency at project level
Addressing invalid edits in code optimization
Ensuring correctness in automated code editing
Innovation

Methods, ideas, or system contributions that make the work stand out.

Hybrid framework for project-level code optimization
Dependency-aware function sequence construction for edits
Automatic code editing ensuring correctness and integrity
πŸ”Ž Similar Papers
No similar papers found.
Xiaoxue Ren
Xiaoxue Ren
Zhejiang University
Software Engineering
J
Jun Wan
Hangzhou High-Tech Zone (Binjiang) Institute of Blockchain and Data Security, Zhejiang University, Hangzhou, China
Y
Yun Peng
The Chinese University of Hong Kong, Hong Kong, China
Zhongxin Liu
Zhongxin Liu
Zhejiang University
Software EngineeringLarge Language Models
M
Ming Liang
Ant Group, Hangzhou, China
D
Dajun Chen
Ant Group, Hangzhou, China
W
Wei Jiang
Ant Group, Hangzhou, China
Y
Yong Li
Ant Group, Hangzhou, China