How to find out clock cycles, overall performance, etc. programs?

I have 3 different algorithms that all calculate the same stuff. My goal is to compare all three algorithms i.e. Clock cycles, "how CPU intensive it will be", time needed to get the final result, overall performance, etc ...

How can I view / get / analyze all this information?

I am programming in Matlab and in C language at code composer studio for an embedded system.

EDIT: Using / managing memory would be useful for an embedded system too, especially

+3


source to share


2 answers


First, you can compare the size of your output files. In most cases, the larger one is slower.

Getting accurate clock cycles is not easy. you have to know how many clock cycles you need the Assembler command and calculate it for your code.



If you use it right on your hardware, you can switch the port at the start and end points and take time measurements. (Note that there may be interruptions that can slow you down)

+1


source


For the MATLAB part, you should use the timeit function to evaluate performance. You can also use profile to check which parts of your code are causing bottlenecks.



0


source







All Articles