This paper presents a novel approach to software performance analysis by integrating traditional profiling techniques with a fine-tuned large language model (LLM), based on the Llama-3 model. Addressing the challenges of manual profiling – such as overwhelming data volumes and the high expertise required to interpret performance metrics – the study introduces a lightweight AI-powered profiler trained on structured JSON-based profiling logs and code samples. The model is fine-tuned using parameter-efficient methods (LoRA and QLoRA) to classify performance bottlenecks (e.g., $N+1$ queries, blocking I/O, recursion) and generate actionable recommendations. The article provides a comprehensive methodology, from dataset preparation and model training to inference and integration, enabling local deployment even without access to high-end GPUs. This fusion of performance engineering and generative AI showcases a scalable, accessible solution for developers, enhancing the speed and precision of bottleneck detection and representing a step toward more automated software optimization.
- Akinshin A. Pro .NET Benchmarking: The Art of Performance Measurement. Apress Berkeley, CA (2019).
- Russell S., Norvig P. Artificial Intelligence: A Modern Approach. Pearson Series in Artificial Intelligence, Pearson (2020).
- Amazone Code Guru documentation. https://aws.amazon.com/codeguru/profiler/features.
- Data Dog Flame Graph documentation. https://www.datadoghq.com/knowledge-center/distributed-tracing/flame-graph/.
- Palkar S., Suri S., Bailis P., Zaharia M. Exploring the Use of Learning Algorithms for Efficient Performance Profiling. https://people.eecs.berkeley.edu/~matei/papers/2018/mlforsystems_profili....
- Unsloth documentation. https://docs.unsloth.ai/get-started/fine-tuning-guide.
- BenchmarkDotNet documentation. https://benchmarkdotnet.org.
- Performance profiling with Python. https://realpython.com/python-profiling.
- Wengrow J. A Common-Sense Guide to Data Structures and Algorithms (2020).
- Caelen O., Blete M.-A. Developing Apps With GPT-4 and ChatGPT: Build Intelligent Chatbots, Content Generators, and More (2023).
- https://github.com/d0vbysh/Llama-Fine-Tuning-with-Unsloth.
- Unsloth integration documentation on Hugging Face. https://huggingface.co/blog/unsloth-trl.
- Nield T. Essential Math for Data Science. Take Control of Your Data with Fundamental Linear Algebra, Probability, and Statistics (2019).