PerfInsights:使用生成式 AI 检测 Go 代码中的性能优化机会
At Uber, back-end service efficiency directly influences operational costs and user experience. In March 2024 alone, the top 10 Go services accounted for more than multi-million dollars in compute spend alone —an unsustainable amount that underscored the need for systematic performance tuning.
在 Uber,后端服务效率直接影响运营成本和用户体验。仅在 2024 年 3 月,前 10 个 Go 服务的计算支出就高达数百万美元——这一不可持续的数额凸显了系统性性能调优的必要性。
Traditionally, optimizing Go services has required deep expertise and significant manual effort. Profiling, benchmarking, and analyzing code could take days or even weeks. Performance tuning is prohibitively expensive and non-trivial for most teams.
传统上,优化 Go 服务需要深厚的专业知识和大量手工劳动。分析、基准测试和代码剖析可能需要数天甚至数周。对大多数团队而言,性能调优既昂贵又非易事。
PerfInsights was born as an Uber Hackdayz 2024 finalist and has since evolved into a production-ready system that automatically detects performance antipatterns in Go services. It uses runtime CPU and memory profiles with GenAI-powered static analysis to pinpoint expensive hotpath functions and recommend optimizations.
PerfInsights 诞生于 Uber Hackdayz 2024 决赛,并已演进为一个可投入生产的系统,能够自动检测 Go 服务中的性能反模式。它利用运行时 CPU 和内存剖析,结合 GenAI 驱动的静态分析,精确定位开销巨大的热点函数并给出优化建议。
The results have been transformative. Tasks that once required days now take hours. Engineers can now deliver high-impact performance improvements without needing specialized knowledge of compilers or runtimes.
结果令人振奋。曾经需要数天的任务现在只需数小时即可完成。工程师无需具备编译器或运行时的专业知识,就能交付高影响力的性能改进。
What distinguishes PerfInsights is its emphasis on precision and developer trust. Beyond identifying optimization opportunities, PerfInsights validates them using large language model (LLM) juries to reduce hallucinations and increase confidence in its suggestions. With hundreds of diffs already generated and merged into Uber’s Go monorepo, PerfInsights has turned optimization from a specialist endeavor into a scalable, repeatable practice.
PerfInsights 的独特之处在于其对精确性和开发者信任的强调。除了识别优化机会外,PerfInsights 还使用大型语言模型 (LLM) 陪审团来验证这些机会,以减少幻觉并提高建议的可信度。已有数百个 diff 被生成并合并到 Uber 的 Go monorepo 中,PerfInsights 已将优化从专家专属任务转变为...