Synthesizing Performance Constraints for Evaluating and Improving Code Efficiency

Jun Yang, Cheng-Chi Wang, B. A. Stoica, Ke-Xin Pei
5/1/2025

No confident code implementation found for this paper.

Abstract

Large Language Models (LLMs) have been increasingly used to optimize code efficiency. Evaluating their effectiveness and further suggesting optimization opportunities often rely on high-quality tests to demonstrate the performance bottlenecks presented in the program.

Show full abstract

However, existing approaches rely on a limited set of hand-curated inputs or LLM-generated uninteresting length-stressing tests, failing to reveal more nuanced optimization opportunities. We present WEDGE, a framework for generating performance-stressing input given the program under test. WEDGE synthesizes explicit performance-characterizing constraints in the form of branch conditions to partition the programs'execution space into performance-specific regions. When integrated with the coverage-guided fuzzer, reaching different regions introduces explicit rewards for test generation to explore inefficient implementations. Our evaluation shows that WEDGE introduces a significant slowdown compared to the tests in CodeContests and those claimed to be optimized by existing approaches. From the utility perspective, integrating our tests substantially improves the existing code optimization approaches that rely on test-driven execution feedback. We release PERFFORGE, the performance tests generated by WEDGE, to benchmark future approaches for efficient code generation at https://github.com/UChiSeclab/perfforge.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{yang2025synthesizing,
  title  = {Synthesizing Performance Constraints for Evaluating and Improving Code Efficiency},
  author = {Jun Yang and Cheng-Chi Wang and B. A. Stoica and Ke-Xin Pei},
  year   = {2025},
  eprint = {2505.23471},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2505.23471},
  url    = {https://doi.org/10.48550/arXiv.2505.23471},
  journal = {Neural Information Processing Systems}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2505.23471.svg)](https://codeofpaper.com/paper/2505.23471)

Discussion