How to turn on compiler optimization to speed up my UI

Description

How to turn on compiler optimization to speed up my UI

What MCU/Processor/Board and compiler are you using?
CPU:ARM Cortex-M4 compiler:gcc

What do you want to achieve?
speed up my UI dispaly through turn on compile optimization

What have you tried so far?

Code to reproduce

Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.

The code block(s) should be formatted like:

/You code here/

Screenshot and/or video

If possible, add screenshots and/or videos about the current state.

This is not relevant to LittlevGL but rather to GCC.

Here is the GCC documentation: https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html