Is it possible to analysis executed operations of a Matlab code?
Show older comments
Hi, Is there a possibility to have matlab do a performance analysis on how many operations were executed? The reason is that the code I am writing should be transfered to a embedded system. However in order to get a good estimation on how fast the program will be executed on the embedded system, I'd like to know how many multiplications, additions, and so on, are executed. The profile viewer only seems to give me the overall execution time, which isn't very helpful because my embedded system most likely won't have a GPU or multiple cores.
1 Comment
Adam
on 19 Jan 2017
The profiler gives a breakdown of numbers of calls. I'm not sure if it goes as deep down the tree as basic plus, multiplication operations as they have never been of interest to me, but it certainly gives more information than just time.
Accepted Answer
More Answers (1)
Walter Roberson
on 19 Jan 2017
2 votes
No, that feature has not been available for a decade or so. The high performance routines used could no longer measure flops, and the measurement was getting increasingly meaningless with newer CPUs.
There have been a small number of posts about modeling the energy usage of VHDL or FPGA, but I cannot seem to locate those at the moment.
How low of a processor are you thinking of deploying to? For example, ARM processors (ARM7 and later at least, not sure about earlier) use multistage pipelining, which can make the cost of instructions more difficult to calculate. I also see in an article that there are floating point accelerators and SIMD (Single Instruction Multiple Data) processors for ARM, which again confuse costs -- a calculation that can be put through SIMD can execute faster than linearly in the number of operations.
1 Comment
John D'Errico
on 19 Jan 2017
This is why flops has been gone for a long time. Simple flop counts are not at all valid any more, given the abilities of processors today, and things will get only worse. Sadly, thesis advisors, reviewers, etc., all think that flops counts still make sense. Yes, you can compute theoretical flop counts for simple algorithms, valid or not on your CPU. But asking your computer to do so for you simply won't work anymore.
Categories
Find more on Speed and Area Optimization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!