Back{: .button}
# Compile with flag -fprofile-generate
gcc -omain main.c -O3 -fprofile-generate=<dir>
# Generate profile for the execution
./main
# Use the generated profile to optimize the binary
gcc -omain main.c -O3 -fprofile-use=<dir>
Note: The profiling build is run on multiple inputs to generate a profile that resembles the actual workload. Coverage with
gprofis used to help with this step