Suryansh Sijwali, Angela Colom and Anbi Guo
Performance bugs hinder software efficiency and scalability, leading to excessive resource consumption, slower execution times, and higher memory usage, especially in large-scale applications. Detecting and fixing these bugs is crucial to improving system performance and reducing computational overhead. In this work, we leverage machine learning models, specifically large language models (LLMs), to identify and correct performance issues in Java programs. Our dataset consists of 490 performance bugs sourced from the Defects4J repository. We implement a structured pipeline to extract and classify performance-sensitive code changes, incorporating pattern-based heuristics and automated structural analysis. The trained LLM is evaluated based on its accuracy in detecting and fixing performance bugs, achieving an overall accuracy of 83.7% in identifying performance issues and 90.2% in generating correct bug reports, outperforming the base model by over 16%.. The findings highlight the potential of AI-assisted bug detection in optimizing software performance. Future work aims to expand the dataset and improve model accuracy.