To analyze performance bottlenecks, you need an environment and a sample application to profile. In this section, you configure an Arm Performix connection and build a Mandelbrot set generator.
A Mandelbrot set generator is a classic computer science application used to test computational performance. It calculates a famous mathematical fractal by performing intense, repeated mathematical operations (often floating-point) for every pixel in a large image. Because the math for each pixel is independent of the others, it’s a highly parallelizable workload that’s perfect for demonstrating CPU optimizations like vectorization and loop unrolling.
Make sure Arm Performix is installed on your host machine. The host machine is your local computer where the Arm Performix GUI runs, and it can be a Windows, macOS, or Linux machine. The target machine is the Linux server where your application is compiled and where the application runs.
If you don’t have Arm Performix installed, see the Arm Performix install guide .
From the host machine, open the Arm Performix application and navigate to the Targets tab. Set up an SSH connection to the target that runs the workload, and test the connection. For the examples in this guide, you connect to an Arm Neoverse-based server.
The Arm Performix collection agent requires Python and binutils to run on the target machine.
Connect to your target machine using SSH and install these required OS packages. This includes the GNU C++ compiler.
For Ubuntu and other Debian-based distributions, run the following command:
sudo apt-get install python3 python3-venv build-essential -y
Download the sample application from GitHub, which is a Mandelbrot set generator provided under the Arm Education License .
cd $HOME
git clone https://github.com/ArmDeveloperEcosystem/mandelbrot-example.git
Run the provided setup script to build the baseline application:
./build.sh baseline
This builds the scalar version of the application, no vectorization is used.
When the build completes, a binary named mandelbrot-baseline is created in the ./builds directory.
The application requires one argument: the number of threads to use. Run this new executable with 4 threads:
./builds/mandelbrot-baseline 4
The application generates a bitmap image file in your ./images directory that looks similar to the following fractal:
Mandelbrot Set
In this section:
Next, you’ll use the CPU Microarchitecture recipe to identify performance bottlenecks in the application.