Reputation: 99
I call from my C++ code a DLL that was written in MATLAB. I observe a strange effect: the first call takes much more time that the next calls. It takes 3-4 times more. Is it normal? Is it possible to do something with it?
Upvotes: 5
Views: 278
Reputation: 8511
Yes that is normal, the delay comes from starting up the MATLAB Runtime Compiler. This is what runs the MATLAB code from the dll that you created through MATLAB. The initial startup cannot be avoided AFAIK, but you can maybe add a dummy call to the DLL when your application begins in order to avoid the "cost" later.
Upvotes: 3