CodeEvolve: LLM-Driven Evolutionary Optimization with Runtime-Enriched Target Selection for Multi-Language Code Enhancement
CodeEvolve is an AI-driven evolutionary framework that automates code optimization by using LLMs, runtime profiling, and Monte Carlo Tree Search to identify and improve performance bottlenecks. The system achieves significant speedups (15.22x average) on enterprise Java codebases while maintaining functional correctness through rigorous validation pipelines.
CodeEvolve represents a meaningful advancement in automated software optimization by combining evolutionary algorithms with modern LLM capabilities and runtime instrumentation. Rather than relying on manual developer identification of performance bottlenecks, the framework uses Java Flight Recorder profiles to automatically build weighted component graphs that identify the actual execution hotspots. This data-driven approach reduces human error and effort in performance engineering.
The framework's architecture integrates multiple validation layers—build checks, unit tests, performance benchmarks, static analysis, and LLM-based code review—ensuring that optimizations don't introduce regressions or bugs. The reported 15.22x speedup across seven hotspot functions in real enterprise environments suggests practical applicability beyond academic settings. The ablation study showing 19.5 valid programs out of 20 with full MCTS configuration indicates that systematic search and filtering meaningfully improve optimization reliability compared to single-pass LLM approaches.
For software development organizations, this work suggests that AI-assisted code optimization can deliver production-ready improvements when properly validated and constrained. The multi-language support (Java and Salesforce Apex) indicates expanding applicability across enterprise technology stacks. However, the framework's effectiveness appears dependent on comprehensive runtime profiling and thorough validation infrastructure, limiting deployment to well-instrumented codebases with strong testing practices.
The research validates that combining evolutionary search, LLM generation capabilities, and domain-specific constraints produces better outcomes than naive AI-assisted optimization. Future applications may extend this pattern to other performance-critical domains beyond code optimization.
- →CodeEvolve achieves 15.22x average speedup on enterprise Java hotspots using automated LLM-guided optimization with runtime profiling
- →The framework uses Java Flight Recorder profiles to automatically identify optimization targets, eliminating manual bottleneck detection
- →Multi-stage validation (build, tests, performance, static analysis, LLM review) ensures functional correctness while filtering 95% valid programs
- →MCTS-augmented search configuration outperforms single-pass LLM optimization and contributes meaningfully to solution reliability
- →Support for Java and Salesforce Apex demonstrates practical applicability to enterprise technology stacks beyond research prototypes