MATLAB 2020b slow to return errors
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Background
My workplace supports a variety of different Matlab versions with the most current version being 2020b. I've been using 2016a though beacause 2020b is so slow to return errors that makes it unusable.
I put the following code in a test script called speedTest.m that's purposely written to cause an error.
char()+cell(1)

I then ran the script in both versions of Matlab using the profiler to illustrate the problem.
2016a
Running the profiler in 2016a, the script runs quickly and returns the expected error:

2020b
Running the profiler in 2020b, the script is very slow to run and return the expected error:

Things I've Tried
I read this thread that suggests the problem is due to Matlab searching network drive paths for variables and functions which can be slow. My startup script does add a bunch of network drive paths for functions and libraries that our group uses but I run the exact same startup script in any version of Matlab I use. The slow error return has never been a problem in the 4 years that I've been using 2016a. I've been able to get by using 2016a but now I need to work with third party Matlab code that requires a newer version (because the string() function didn't exist in 2016a).
Question
It looks like error checking changed between versions but why is it so much slower in 2020b?
14 Kommentare
Chris
am 7 Mär. 2023
Bearbeitet: Chris
am 7 Mär. 2023
My thought process was, the network drive is at the top of the search path. If the connection is dropped (or refused?), the delay will occur when Matlab looks there first. Indeed, the first time I try anything in Matlab (any function, doesn't have to cause an error. "1+1" does it) after disconnecting from the VPN, the delay occurs. Something happens after that first attempt that prevents the delay for that function, but now try "1-1" and there's the delay again.
On the other hand, if Matt's problem is really only triggered by calls to error(), then perhaps it's unrelated.
For the record, I think these servers use smb (though I'm not sure how Windows would know that before connecting)
@dpb interestingly, your speed test doesn't catch the 20s delay.
Antworten (0)
Siehe auch
Kategorien
Mehr zu Manage Products finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!