一句话:提出差分剖析与LLM引导推理的仓库级时间低效修复定位框架,并构建首个基准RepoEffi-Bench。
大型软件系统常存在时间低效问题,虽功能正确却执行过慢,定位其修复位置十分困难。与功能缺陷不同,时间低效不会导致崩溃或测试失败,缺乏二元判据与堆栈线索,传统故障定位和近期LLM方法难以适用;单次运行时剖析又无法区分低效热点与执行噪声,且从海量背景执行中抽取相关路径困难,观测到的低效与修复位置之间还存在语义鸿沟。本文提出EffiHolmes:首先用默认与放大负载的差分剖析定位低效热点;其次抽取连接热点与所报告低效函数的紧凑执行路径;最后以领域启发式引导LLM推理定位低效逻辑。为便于评估,作者构建了RepoEffi-Bench,包含140个来自流行Python仓库的高质量时间低效问题。结果表明,EffiHolmes持续优于基于检索、智能体和剖析的基线,在GPT-5.1文件级Acc@3上提升4.29个百分点,在qwen3-4b函数级Acc@5上提升15.00个百分点,且跨模型能力保持鲁棒。
Large software systems often suffer from time inefficiencies, leading to excessive execution time despite functional correctness. Local- izing the fix locations of such inefficiency issues is notoriously difficult. Applying existing fault localization paradigms to this task presents significant challenges. Unlike functional bugs, time ineffi- ciencies do not cause crashes or test failures. They therefore provide neither binary oracles nor stack-trace localization clues, making traditional fault localization and recent LLM-based methods not ap- plicable. While runtime profiling provides alternative clues, it faces some challenges in repository-level settings. Single-run profiling is non-discriminative, failing to distinguish inefficiency hotspots (i.e., time-consuming functions) from execution noise. Furthermore, existing profilers struggle to extract the execution paths relevant to inefficiency from the vast background execution. Crucially, even with the extracted execution paths, a semantic gap still persists between the observed inefficiency and where to fix. In this paper, we propose EffiHolmes, an LLM-based frame- work for localizing fix locations of repository-level time inefficiency issues. First, it employs differential profiling (default vs. scaled workloads) to pinpoint inefficiency hotspots. Second, to extract the execution paths relevant to inefficiency, it performs execution path extraction, constructing compact execution paths that connect hotspots to the reported inefficient function. Third, to bridge the gap between the hotspots and fix locations, it employs guided LLM reasoning with domain heuristics to locate the inefficiency logic. To facilitate the evaluation, we introduce RepoEffi-Bench, the first benchmark for repository-level inefficiency localization, consisting of 140 high-quality time inefficiency issues collected from popular Python repositories. The results show that EffiHolmes consis- tently outperforms state-of-the-art retrieval-based, agent-based, and profiling-based baselines, with gains of 4.29 pp on GPT-5.1 file- level Acc@3 and 15.00 pp on qwen3-4b function-level Acc@5 over the best baseline. It also remains robust across model capacities.