# Identify and optimize code hotspots using the Arm Performix MCP server

## In this learning path

- [Introduction](https://learn.arm.com/learning-paths/servers-and-cloud-computing/performix-mcp-agent/)
- [Understand AI-driven profiling with the Arm Performix MCP server](https://learn.arm.com/learning-paths/servers-and-cloud-computing/performix-mcp-agent/1-overview/)
- [Build the Mandelbrot example on Arm Neoverse](https://learn.arm.com/learning-paths/servers-and-cloud-computing/performix-mcp-agent/2-setup/)
- [Run Code Hotspots with an AI agent](https://learn.arm.com/learning-paths/servers-and-cloud-computing/performix-mcp-agent/3-run-hotspot/)
- [Optimize code with AI-driven profiling feedback](https://learn.arm.com/learning-paths/servers-and-cloud-computing/performix-mcp-agent/4-optimize/)
- [Next Steps](https://learn.arm.com/learning-paths/servers-and-cloud-computing/performix-mcp-agent/_next-steps/)

## About this Learning Path

|  |  |
| --- | --- |
| Skill level: | Advanced |
| Reading time: | 30 min |
| Last updated: | 11 Sep 2026 |

|  |  |
| --- | --- |
| Author: | Pareena Verma , Arm<br>[GitHub](https://github.com/pareenaverma)<br>[LinkedIn](https://linkedin.com/in/pareena-verma-7853607) |
| Arm IP: | [Neoverse](https://support.arm.com/?tab=compute-ip&Product%20Type=Infrastructure%20Processors) |
| Tags: | [Performance and Architecture](https://learn.arm.com/tag/performance-and-architecture) [Linux](https://learn.arm.com/tag/linux) [Arm Performix](https://learn.arm.com/tag/arm-performix) [MCP](https://learn.arm.com/tag/mcp) [CPP](https://learn.arm.com/tag/cpp) [GitHub Copilot](https://learn.arm.com/tag/github-copilot) |

### Who is this for?
This is an advanced topic for developers who want to use AI-powered tools to automate performance profiling and optimization of C++ applications on Arm Neoverse servers.

### What will you learn?
After completing this Learning Path, you'll be able to perform the following tasks:
- Describe how the dedicated Arm Performix MCP server enables AI-driven profiling workflows
- Run the Code Hotspots recipe on a configured remote Arm target through an AI agent
- Use an AI agent to interpret profile evidence and identify the hottest functions in a C++ application
- Apply AI-suggested optimizations to reduce application runtime on Arm Neoverse

### Prerequisites
Before starting, you'll need the following prerequisites:
- Completion of the [Generate Arm Performix AI insights in Visual Studio Code with Codex](https://learn.arm.com/learning-paths/servers-and-cloud-computing/performix-agentic-dynamic-insights-codex/) Learning Path, or equivalent familiarity with configuring the Arm Performix MCP server in an AI coding assistant
- Access to an Arm-based cloud instance running Linux, such as an AWS Graviton3 instance
- Access to Arm Performix configured with the remote Arm target. See the [Arm Performix install guide](https://learn.arm.com/install-guides/performix/) for setup instructions
- Basic understanding of C++

### Summary
You’ll combine the dedicated Arm Performix MCP server with an AI agent to run the complete Code Hotspots workflow on an Arm Neoverse target. First, you’ll build an intentionally unoptimized Mandelbrot C++ application on a remote Arm Linux target, then use an AI agent to run the Performix Code Hotspots recipe. The agent confirms the configured target, executes collection, and returns a run ID. You’ll use that run ID to generate AI insights with structured hotspot data to pinpoint the hottest functions. Guided by the agent, you’ll apply concrete code changes, such as math simplifications and enabling a higher optimization level, through your source and build environment. Then, you’ll re-run the recipe to compare results. The end-to-end flow keeps profiling, interpretation, and edits within a single AI-assisted loop.

### Frequently Asked Questions
**How do I configure the Arm Performix MCP server?**
Follow the [Generate Arm Performix AI insights in Visual Studio Code with Codex](https://learn.arm.com/learning-paths/servers-and-cloud-computing/performix-agentic-dynamic-insights-codex/) Learning Path to start the installed `apx` executable with the `mcp start` arguments and verify that your AI coding assistant can list Performix recipes and configured targets.

**What result should I expect after the profiling run completes?**
Expect a completed run status and a run ID. Use that run ID to request an AI insight with a hotspot summary that highlights the hottest functions in the Mandelbrot application. Use this output to guide which code changes to apply first.

**Should I compile the Mandelbrot example with optimizations before profiling?**
No. The single-threaded, unoptimized build is intentional so the hotspot analysis produces a clear signal. The agent later proposes enabling `-O3` as part of the optimization pass.

**How do I know the agent is targeting the correct machine?**
The agent explicitly confirms your configured Performix target name and workload before running the Code Hotspots recipe. Review this confirmation and proceed only if it matches your intended Arm target.

**What should I check if the Code Hotspots run fails to start?**
Confirm that Arm Performix is configured with your remote Arm target and that the target connection succeeds. Also verify that the Mandelbrot application builds on the target system. You can test the connection with `apx target test --target <target-name>`.
