I want to port my Matlab Code to a C / C++ code. What are the essential rules to pay attention to, when creating a ressource-friendly code for real-time application?
For example: How to realize vector operation in C? Should I go with a for-loop and process element by element?
Well,
DO not use the automatic conversion of matlab to C using the mcc command.
Try to use a compiler that supports vectoring like the new gcc versions.
If your performance is not met, we can discuss more about it here in this thread.
--
Amr
thanks for your reply.
Ok, I will use a new gcc compiler.
I want to implement an audio-application as a VST-Plug-In for real-time processing.
I used to process each element in an array for its own, and increased a pointer in a for loop. But I guess, a vectoring compiler would do it faster, wouldn´t it?
Currently I´v just started implementing and due to the low amount of code I wrote (only some lines) I would like to ask in advance, if the usage of vectoring will be faster than a For-Loop ?
The vector extention you mentioned and which I gave a link seems to complicated to me. I will give IT++ (ITPP) a try. It is similar to matlab´s syntax, but with a good speed.