Slow first MATLAB start

7 次查看(过去 30 天)
Andrei
Andrei 2025-3-24
While creating Azure Windows image for MATLABs we noticed it works very slow during the first call.
To make it work faster we added the execution of the code below before packer created image:
$matlabCommand = "-batch `"version, ver -support, pause(10), exit`""
$matlab_dirs = Get-ChildItem -Path "C:\Program Files\MATLAB\R*" # find all matlab versions
foreach ($matlab_dir in $matlab_dirs) {
$matlabPath = "$matlab_dir\bin\matlab.exe" # This is where the executable is
if (Test-Path $matlabPath) {
Write-Host "Initializing $matlab_dir"
cmd /c "`"$matlabPath`" $matlabCommand"
}
MATLAB started to work faster but still slow comparing to the second run on the same Azure machine.
What could be done to make it work faster?
we use MATLAB installer so MATLAB Startup Accelerator task is present on the machine.
I saw WarmUp-MATLAB.ps1 it should work as Startup Accelerator as it uses the same binary.
P.S. we spin up the Azure machine only for 1 build so we are looking for any solution which could be adopted by packer.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

标签

产品


版本

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by