WHY ITS TAKING TIME TO LAUNCH MATLAB EXE FILE IN VISUAL STUDIO C++?

2 vues (au cours des 30 derniers jours)
Hemanth Reddy
Hemanth Reddy le 21 Fév 2025
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

Réponses (2)

Karan Singh
Karan Singh le 26 Fév 2025
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

Walter Roberson
Walter Roberson le 26 Fév 2025
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.

Catégories

En savoir plus sur MATLAB Compiler dans Help Center et File Exchange

Produits


Version

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by