# Run an optimization

{% stepper %}
{% step %}

### Analysis results

![](/files/644c8770b6fb53709a022de3bec0da2d9b04f07d)

On the analysis dashboard, click on *Optimize*.
{% endstep %}

{% step %}

### Optimization strategy settings

![](/files/078769a0583fd8b40dae192144ef703b863c7613)

On the optimization strategy page, you can see the details of all optimizations that were found on your code, and generate code for the ones that are automatically optimizable.

![](/files/2289ca5bc33e332d09db54b2eadf14dc4304cd6b)
{% endstep %}

{% step %}

### See optimization details

![](/files/e495fc95bbf3d0bab1cf92cb7fd1ef6ae6cf626e)

In the file tree, you may enter the files and functions where optimizations were found. For that, click on *See details*.

![](/files/7e74cbc05b49a71ca26e87f3687f332cc8f4f8e8)

There, you can see the optimizations that were found, where they have impact on the code, what parts of the code are concerned by the optimizations and how they work. Go back to the optimization strategy by clicking on the top left arrow.
{% endstep %}

{% step %}

### Go to optimization kinds selection

![](/files/1303c12646ecd601bfa5d79152b1e5c46c196efd)

On the main page, clicking on *Optimization kinds selection* on the project root, any directory, file or function allows to activate or not optimizations on that level. Click on it on the project root.

![](/files/1303c12646ecd601bfa5d79152b1e5c46c196efd)

There, activate all available automatic optimizations, and click on *Confirm*.
{% endstep %}

{% step %}

### Optimization preview

![](/files/c0945b67d610bcd995269fe86cbcfea939d6c2ac)

Click on the play button to start an optimization score preview. This way, you can have a quick estimation of the gains given the optimizations which were activated in your strategy.

![](/files/72c3b98ef8cb59c97b7eba180c231d216afd3676)

After a few seconds, we can see that automated optimizations could bring an estimated 9.2% performance improvement in the FFT-C code.
{% endstep %}

{% step %}

### Run the optimization

![](/files/70b3cc24930973160206fa3ddd6b90463521db18)

Click on *Run optimization* to actually generate modified source code implementing the selected optimizations.

At that point, you can click on *Download code* to get the optimized code.
{% endstep %}

{% step %}

### Optimized code analysis

![](/files/1436f2e5c933b23f56f5274c7b41d2109bf7af50)

To go further, you can run a new analysis on the optimized code to acknowledge better the impact of the newly generated code.

Click on *Run analysis*. After that, you can see the same metrics as for the initial analysis, but for the optimized code, to see the actual effects of the optimizations.

For instance, you can see that now, the app\_exec top function is estimated to take 7.92K cycles, while it originally took 8.62K cycles, leading to an 8.2% improvement. You can also check how the functionality repartition has changed.
{% endstep %}

{% step %}

### Code diff

![](/files/8e5b533d4fd00a1f7407318b9ab7625d642d9f13)

By coming back to the optimization details, in the file tree, you may click on *Compare file* to see the code difference between before and after optimization.

![](/files/21405cdf2541e7586ca289660702c12b1cb492c2)

Now, you may take advantage of the optimized code as you wish.

Don't forget to have a look at non-automatic optimizations too, so you can understand what is the problem and take decisions about what you could or could not be changing to improve your code performance even better.
{% endstep %}
{% endstepper %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wedolow.com/documentation/below/quickstart/run-an-optimization.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
