Performance of SystemObject vs Class
Lately, I was introduced to SystemObjects and some of its benefits, for example that one can use them in Matlab as well as in Simulink which is important to me. So I started playing around with SystemObjects and quickly ended up in a scenario where I have a main SystemObject in which I create instances of other SystemObjects which themselves create instances of other SystemObjects. So to say: nested SystemObjects.
Now, for my understanding: If I want to use the main SystemObject only in both Matlab and Simulink then I could replace the other SystemObjects with normal classes. And here comes the question: Would that increase the performance of the generated code?
The reason why I am wondering is the fact that in languages like C++ inheritance from classes with virtual methods cause runtime costs (at least that’s what I understood). I guess in the case of SystemObjects which inherit from the matlab.System class something similar will happen?Lately, I was introduced to SystemObjects and some of its benefits, for example that one can use them in Matlab as well as in Simulink which is important to me. So I started playing around with SystemObjects and quickly ended up in a scenario where I have a main SystemObject in which I create instances of other SystemObjects which themselves create instances of other SystemObjects. So to say: nested SystemObjects.
Now, for my understanding: If I want to use the main SystemObject only in both Matlab and Simulink then I could replace the other SystemObjects with normal classes. And here comes the question: Would that increase the performance of the generated code?
The reason why I am wondering is the fact that in languages like C++ inheritance from classes with virtual methods cause runtime costs (at least that’s what I understood). I guess in the case of SystemObjects which inherit from the matlab.System class something similar will happen? Lately, I was introduced to SystemObjects and some of its benefits, for example that one can use them in Matlab as well as in Simulink which is important to me. So I started playing around with SystemObjects and quickly ended up in a scenario where I have a main SystemObject in which I create instances of other SystemObjects which themselves create instances of other SystemObjects. So to say: nested SystemObjects.
Now, for my understanding: If I want to use the main SystemObject only in both Matlab and Simulink then I could replace the other SystemObjects with normal classes. And here comes the question: Would that increase the performance of the generated code?
The reason why I am wondering is the fact that in languages like C++ inheritance from classes with virtual methods cause runtime costs (at least that’s what I understood). I guess in the case of SystemObjects which inherit from the matlab.System class something similar will happen? performance, systemobject, class, inheritance, matlab.system, code generation MATLAB Answers — New Questions