WHY ITS TAKING TIME TO LAUNCH MATLAB EXE FILE IN VISUAL STUDIO C++?
2 次查看(过去 30 天)
显示 更早的评论
I HAVE CREATED MATLAB EXE FILE TO CONTROL ON VVISUAL STUDIO BUT THE CODE WHICH IS TAKING 8 SEC IS TAKING 20 SEC WHEN WE CALL THROUGH EXE FILE . BUT WHEN WE KEEP THE TIMER IN MATLAB EXE CODE ITS SHOWING 9-10 SEC THAT MEANS ITS TAKING NEARLY 10 SEC TO LAUNCH . IAM GIVING INPUT FROM VISUAL STUDIO TO MATLLAB EXE FILE AND EXTRACTING OUTPUT FROM MATLAB EXE FILE TO VISUAL STUDIO. IS THERE ANY WAY TO SOLVE THIS ISSUSE ? IS THERE ANY WAY TO REDUCE THE LAUNCH TIME BY MATLAB EXE FILE
0 个评论
回答(2 个)
Karan Singh
2025-2-26
When you launch your MATLAB executable, which relies on the MATLAB Compiler Runtime (MCR), from Visual Studio, a significant portion of the delay comes from initializing the runtime environment. This overhead is inherent to how MATLAB-compiled applications start up, so if you call the EXE repeatedly, you incur this startup cost every time.
The suggestions can be quite generic but, instead of launching a new MATLAB EXE for every call, try designing your application so that the MCR is started only once. Additionally, if your code does not require Java features, you might consider launching it with options such as "-nojvm" to reduce startup time.
Karan
0 个评论
Walter Roberson
2025-2-26
The official solution is to use MATLAB Production Server https://www.mathworks.com/products/matlab-production-server.html
Production Server keeps some MATLAB instances "warm", ready to be invoked on short notice.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!