Code ran by (C++ API call) engEvalString() is slower

조회 수: 1 (최근 30일)
Zohar
Zohar 2017년 4월 23일
답변: Zohar 2017년 4월 24일
I noticed something disturbing. Executing Matlab code from C++ with the API call to engEvalString() runs twice as slow than running it within matlab.
I profiled and also manually timed the code. It's just Matlab basic operations and it has nothing to do with the overhead calling it from outside.
To emphasize, I'm NOT talking about the overhead of the API call. I am measuring the time of the pure Matlab code itself (running within the engine), and it runs slower.
(I'm using Matlab R2016a.)

채택된 답변

Zohar
Zohar 2017년 4월 24일
I found the problem. Before running eval, there was a separate eval of:
clear functions;
This cleared Yalmip's init, and there was a Yalmip overhead re-initializing.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by