Back to feed
Book Open access

Agent-Agnostic End-to-End C/C++ Application Performance Optimization

Jul 2026 · ICS Workshops · 0 citations · 2 references
Computer Science

Abstract

The rise of large language model code agents—Claude Code, Gemini CLI, Codex CLI—has enabled developers to drive models through multi-step programming operations in real codebases via code agent interfaces. Existing work, however, has primarily applied these tools to functional tasks such as bug fixing and feature implementation, leaving performance engineering—a discipline that demands runtime evidence, domain expertise, and rigorous validation—largely unexplored. Moreover, most AI-assisted performance optimization approaches are tightly coupled to a specific model or interface, making them brittle in the face of rapid code agent evolution. We propose a code agent-agnostic agentic scaffold for automated code performance optimization. The scaffold connects to mainstream model code agents through the Model Context Protocol (MCP) and is equipped with a procedural memory module (agent skill) that encodes the complete optimization control loop. This enables the system to autonomously execute the entire pipeline: project-level runtime analysis, hotspot identification and benchmark extraction, Abstract Syntax Tree (AST)-precise code localization, candidate patch generation, functional verification, performance measurement, and version rollback. When straightforward optimization strategies fail, the system escalates by invoking the Retrieval-Augmented Generation (RAG) tool in the MCP layer to retrieve structurally similar human optimization cases as reference patches. We evaluate the system on the 10 CBench benchmark suite [7, 9], and experimental results show our methods can achieve 1.5 × speedup with \(100\%\) success rate. Furthermore, our methods can significantly reduce the token consumption comparing with baseline methods.

Read PDF