用多智能体协作优化微服务系统,提升整体性能
Beyond Local Code Optimization: Multi-Agent Reasoning for Software System Optimization
- 构建多智能体框架,融合控制流与系统依赖信号
- 实现跨组件瓶颈识别,吞吐量提升36.58%
- 适合需要全栈优化的分布式系统开发者
大型语言模型和AI智能体在自动化软件性能优化方面展现出潜力,但现有方法多依赖局部、语法驱动的代码变换,难以推理程序行为或捕捉整个系统的性能交互。随着现代软件越来越多地由微服务、数据库及共享基础设施等相互作用的组件构成,有效的代码优化需超越单个函数或文件,深入理解程序结构与系统架构。本文探索了针对微服务系统的全栈优化可行性,提出一种多智能体框架,结合控制流、数据流表示以及架构和跨组件依赖信号,支持系统级性能推理。该系统分解为协同工作的四个角色:摘要、分析、优化与验证,共同识别跨切面瓶颈并制定覆盖软件栈的多步优化策略。我们在一个基于微服务的系统上实现了概念验证,结果显示吞吐量提升36.58%,平均响应时间降低27.81%。
原文摘要 · Abstract (English)
Large language models and AI agents have recently shown promise in automating software performance optimization, but existing approaches predominantly rely on local, syntax-driven code transformations. This limits their ability to reason about program behavior and capture whole system performance interactions. As modern software increasingly comprises interacting components - such as microservices, databases, and shared infrastructure - effective code optimization requires reasoning about program structure and system architecture beyond individual functions or files. This paper explores the feasibility of whole system optimization for microservices. We introduce a multi-agent framework that integrates control-flow and data-flow representations with architectural and cross-component dependency signals to support system-level performance reasoning. The proposed system is decomposed into coordinated agent roles - summarization, analysis, optimization, and verification - that collaboratively identify cross-cutting bottlenecks and construct multi-step optimization strategies spanning the software stack. We present a proof-of-concept on a microservice-based system that illustrates the effectiveness of our proposed framework, achieving a 36.58% improvement in throughput and a 27.81% reduction in average response time.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。