i am workin’ on: “Code optimization for STM-32 f103/STM-32 F407 Discovery Time and memory”.
i am almost dead. i am not really understanding what should be done).
the task is: “just to try optimization in c/c++ and measure the results.”.
here what i did so far; https://github.com/abdibrokhim/code-optimization-arm
any help, any resources. highly appreciated 🧡
i tried to compare ASM vs C, referencing the book. Here’s:
Using C
compile bubble_sort.c
file using;
gcc bubble_sort.c -03 -o bubble_sort
execute and time the program;
time ./bubble_sort
book says:
execute-time
Using Assembly
compile bubble_sort_asm.s
file using;
gcc -c bubble_sort_asm.s -o bubble_sort_asm.o
execute and time the program;
time ./bubble_sort_asm
compare the execution time of the two programs;
execute-time-c-asm
book says:
execute-time-c-asm-book
Result verification
enter verify
folder and run the following command;
gcc driver.c bubble_sort.c bubble_sort_asm.s -o main
References
- Embedded systems. 2nd edition. ARM Programming and Optimization by Jason D. Bakos. here
abdibrokhim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
4