SWE-Perf: I Modelli Linguistici Possono Ottimizzare le Prestazioni del Codice su Repository del Mondo Reale?
SWE-Perf: Can Language Models Optimize Code Performance on Real-World Repositories?
July 16, 2025
Autori: Xinyi He, Qian Liu, Mingzhe Du, Lin Yan, Zhijie Fan, Yiming Huang, Zejian Yuan, Zejun Ma
cs.AI
Abstract
L'ottimizzazione delle prestazioni del codice è fondamentale nell'ingegneria del software reale e cruciale per i sistemi di livello produttivo. Sebbene i Large Language Model (LLM) abbiano dimostrato capacità impressionanti nella generazione di codice e nella correzione di bug, la loro competenza nel migliorare le prestazioni del codice a livello di repository rimane in gran parte inesplorata. Per colmare questa lacuna, introduciamo SWE-Perf, il primo benchmark progettato specificamente per valutare sistematicamente gli LLM in compiti di ottimizzazione delle prestazioni del codice all'interno di contesti di repository autentici. SWE-Perf comprende 140 istanze accuratamente selezionate, ciascuna derivata da pull request di miglioramento delle prestazioni provenienti da repository GitHub popolari. Ogni istanza del benchmark include il codice rilevante, le funzioni target, test legati alle prestazioni, patch create da esperti e ambienti eseguibili. Attraverso una valutazione completa di metodi rappresentativi che spaziano da approcci a livello di file a livello di repository (ad esempio, Agentless e OpenHands), riveliamo un divario sostanziale tra gli LLM esistenti e le prestazioni di ottimizzazione di livello esperto, evidenziando opportunità di ricerca critiche in questo campo emergente.
English
Code performance optimization is paramount in real-world software engineering
and critical for production-level systems. While Large Language Models (LLMs)
have demonstrated impressive capabilities in code generation and bug fixing,
their proficiency in enhancing code performance at the repository level remains
largely unexplored. To address this gap, we introduce SWE-Perf, the first
benchmark specifically designed to systematically evaluate LLMs on code
performance optimization tasks within authentic repository contexts. SWE-Perf
comprises 140 carefully curated instances, each derived from
performance-improving pull requests from popular GitHub repositories. Each
benchmark instance includes the relevant codebase, target functions,
performance-related tests, expert-authored patches, and executable
environments. Through a comprehensive evaluation of representative methods that
span file-level and repo-level approaches (e.g., Agentless and OpenHands), we
reveal a substantial capability gap between existing LLMs and expert-level
optimization performance, highlighting critical research opportunities in this
emerging field.