Performance issue in Matlab r2025b

186 views (last 30 days)
Guillermo Rubio
Guillermo Rubio on 18 Dec 2025 at 13:35
Commented: Guillermo Rubio about 11 hours ago
Hello,
Today, I decided to update matlab to r2025b (I have been using r2023b since it was released).
First impressions were not good, the first thing I did is to configure the behavior of figures to be the same as in previous releases (to open everytime in the same position and with the default size). I think that opening figures with the size and position of the last figure is not very practical (maybe yes for some users, not at all for me).
Then, another disappointment with the files explorer...now I can not see on a glance if a folder is empty, I have to expand the arrow beside to check it :(, and the symbol next to the csv files is not anymore the excel logo. I know they are not really important topics but I was very used to the previous GUI and seems dificult to get used to the new one.
Anyway, progress is always good so lets give it a chance...
But finally, and the reason of this question, I start running a code that goes trough all the csv files in a folder (lets say 20 files), plots around 60 figures for each file (lots of figures in the end) and saves them, along with some .mat files. I have been using this code with r2023b for long time, it takes some time of course, but with r2025b I would say it takes like x3 or x4 times longer. Any clue if this can be solved?
I still want to give another chance to this release but...doesn't seem very promising. Good thing I didn't started migrating my Simulink models to this version :)
Best regards!
  9 Comments
Benjamin Kraus
Benjamin Kraus 42 minutes ago
@Guillermo Rubio I have two suggestions for you to try to help isolate the cause of the performance regression:
  1. Have you experimented with not setting the figure position and leaving figures docked in the figure container? When I say "docked": the default behavior for figures in R2025a and later is to open docked into a "figure container", which allows multiple figures to occupy the same window. That "figure container" may be docked in the desktop or not. Opening figures that are docked in the figure container will be faster than opening figures that are not docked in the figure container (whether or not the figure container itself is docked in the desktop), but I'm not certain how much of the performance can be accounted for by the undocked figures vs. something else. It would be useful to test how much of a factor docked vs. undocked figures makes in your performance measurements. Note that setting the figure position will cause it to become undocked so to do this experiment you need to stop setting the figure's position.
  2. Can you start the profiler using the additional argument -detail builtin? This will provide a bit more context about what exactly is taking time within savefig.m.
profile on -detail builtin
Then, once you have stopped the profiler, run this code to save the results to a MAT-file and add the MAT-file as as attachment here. Also make sure to indicate exactly what MATLAB release you are using (the full output from version so I can get the point release as well as the major release).
p = profile('info');
save profileResults.mat p
Guillermo Rubio
Guillermo Rubio 3 minutes ago
Hello,
I have tried creating only one figure and then using clf to clear the existing figure and then reusing it for the next one, then saving it, and so on within the loop. This reduces the execution time with r2025b to even less the measured one with r2023a, hence I have accepted Michelle answer.
Just for informaiton, here there are the results obtained with the builtin mode on the profiler activated:
The exact version used is:
25.2.0.3055257 (R2025b) Update 2
Thanks to everyone for the help!
Kind regards,

Sign in to comment.

Accepted Answer

Michelle Hirsch
Michelle Hirsch on 5 Jan 2026 at 13:04
Opening a figure can be slower in R2025b than in R2024b and earlier releases, and I think there can be performance and memory hits from having a very large number of figures open. If you are creating a new figure for each visualization (e.g. calling figure before generating the plot), try reusing the figure instead (e.g. call clf instead of figure). If you were making all figures first and then saving them, you'll want to move your saving code next to figure creation code.
e.g.
Instead of
for ii=1:60
...
f(ii) = figure
...
end
for ii=1:60
...
exportfig(f(ii),"myfig"+ii)
...
end
Try
for ii=1:60
...
f = figure
...
exportfig(f,"myfig"+ii)
end

More Answers (1)

Sean
Sean 7 minutes ago
Edited: Sean 6 minutes ago
Hi Guillermo, with respect to your comment about the Files panel:
"Then, another disappointment with the files explorer...now I can not see on a glance if a folder is empty, I have to expand the arrow beside to check it :("
This change was intentionally made to address users' feedback about navigating around very large directories. In prior releases, the Files panel was too slow to do such operations because, among other things, it had to make extra queries for every folder in order to determine whether to show the "expand" icon. With this change, which is also present in other modern applications, 25a and later can effectively navigate among directories with 10k+ files. That said, I understand that your desire may be different: if there is interest in a setting to control such behavior, please let me know.

Categories

Find more on Entering Commands in Help Center and File Exchange

Tags

Products


Release

R2025b

Community Treasure Hunt

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

Start Hunting!