xPC-target slower than Simulink in my application?!
1 次查看(过去 30 天)
显示 更早的评论
Hi everyone,
I am running a Simulink model consisting of 3 C-mex S-functions with static linked libraries to an optimization solver (IPOPT) linked to them.
This Simulink model runs faster than real-time on my laptop. I am using a delirately large (but allowable) sample-time of 0.5 seconds. The processor can at all times handle the excecutions in that 0.5 seconds time.
When I compile and run on xPC-target, the performance is much, much worse, while the CPU hardware is much better. The Tet time is very steady around 0.36-0.37 seconds. This is not only slower than in Simulink, but also with a lot less variation (a different optimization problem is solved every timestep).
What could be the reason for code to run slower on xPC-target than on Simulink?
Thoughts:
- Item one Does something strange happen when compiling?
- Item two Why do I have to recompile the C mex S-functions for xPC? Can't it use the already generated mex files?
0 个评论
回答(2 个)
Kaustubha Govind
2012-9-24
Martijn: I don't have a lot of experience with xPC Target, so I'll leave others with more expertise to help you our on the performance issue. (Please contact MathWorks Tech Support with your model and configuration information if you do not receive general advice on this forum). I think I can however answer question #2 - MEX-files are essentially shared libraries (DLLs on a PC) with a different extension. I think that format is not suitable for the xPC operating system, so they need to be recompiled to the correct binary format.
0 个评论
Azzi Abdelmalek
2012-9-24
less faster, compared to what? xpc target is supposed to run faster if you boot on a target computer without its OS.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Target Computer Setup 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!