App Designer extremely slow to save and run

251 views (last 30 days)
Joseph Smalley
Joseph Smalley on 16 Jan 2019
Commented: Mark Magdaleno on 20 Jan 2022
I am developing a MATLAB App using App Designer and the program has become extremely slow. Problems that I have include the following:
  1. Delays upto several minutes long between clicking "save" and the program actually saving, as denoted by removal of the asterisk after the file name.
  2. Delays of many minutes after hitting "run"
  3. Delay of many seconds when trying to paste copied text.
  4. Inconsitency or inability of pasting copied text to the point where text is pasted in unintended part of code
  5. Delays in removal of error messages when adding conditional statements
  6. Spiking of CPU and memory usage when "save" or "run" are clicked.
My App is currently 8500 lines of code and contains roughly 120 callbacks and 200 components, along with 20 internal functions. It also calls roughly 20 different external functions.
I have used the same code in 64 bit macOS (High Sierra on 2018 MacBook Pro, 2.6 GHz Intel Core i7, 16 GB 2400 MHz DDR4 memory) and Windows 10 (Dell Inspirion, 3.6 GHz Intel Core i7, 16 GB RAM) and experience similar problems with delays. My temporary solution has been to use the App Designer for ~30 minute periods, close all MATLAB instances, then reopen, and do this repeatedly. App Designer seems to perform better when first started and gradually get slower. I also use MATLAB Compiler to create stand-alone execuatables of the App that I am creating. The compiled versions run fairly smoothly, but editing and debugging them in App Designer has become a major bottleneck of productivity. I have already unchecked "Enable app coding alerts" with the hope of reducing the lag, but this does not seem to have a major effect. I am at the point where I may need to abandon use of App Designer if there are no solutions to this problem.
I notice that most example Apps on Mathworks website are relatively simple so I wonder whether this is a common probelm simply due to the size of the App?
Has MATLAB tested scalability of the App Designer?
Are there any recommendations to improve speed when editing in App Designer?
Has anyone successfully built an App of this scale without dramatic slowdown occuring in the App Editor?
If so, are there any suggestions available or example files of this scale available?
Unfortunately, I am not able to post the code as it is proprietary.
Thank you for you help.
Mario Malic
Mario Malic on 16 Nov 2020
The alternative for the figures that are frequently updated is that you plot on the figure outside of App Designer's uifigure window. This is not a good solution, but it works until this gets fixed.

Sign in to comment.

Answers (12)

Paul Dirac
Paul Dirac on 15 Jan 2020
Unbelievable that The Mathworks cannot do a better job than that. Even an empty app takes half a second or so to settle on my machine (Xeon E3-1505M v6@3GHz processor, 32GB ram) instead of loading without perceptible delay. I don't remember GUIDE sucking as much as App Designer.

Marco Frieslaar
Marco Frieslaar on 30 Apr 2020
I am also experiencing really niggly, frustrating and sometimes hair-pulling issues with Appdesigner (even version 2020a Update 1).
At present, my app consists of 30,804 lines and I am sharing data between Simulink and Appdesigner to create a test-bed kind of system.
The everyday issues that I see (or imagine I see, sometimes I wonder if it is just me...) are:-
1) The longer MATLAB/Appdesigner runs for, without a shut-down, the slower it gets and the more it trips up from time-to-time.
2) The Editor can vary in speed of response and be really annoyingly slow at times.
3) The 'Align' tools seem to stop working for long periods of time, for no apparent reason.
4) I try to regularly save versions of my work and back it up. I do that by using 'Save a copy' and assign the latest date. The message that it gives to say saving is complete, sits right over the same section I need to shutdown the current copy and load the new one. The message takes a while to disappear and slows me down.
5) The cursor seems to jump around under certain circumstances. For example, if I have an error with a Helper function, it can sometimes be due to an unavailable variable in the main part of the code - so I need to flick between the two areas (the Helper function and the main code). As my App is pretty sizeable now, this is an annoying process made worse by the cursor insisting on jumping back to the Helper function when I have just clicked in the main code area.
6) Graphics rendering is really slow (I am using a 15" MacBook Pro, 2.9GHz, 6 Core Intel i9 machine with 32GB DDR4 and a Radeon Pro 560X system). This takes some of the fun out of doing more interesting displays.
7) I would like the option to be able to tell MATLAB to save all of my data in the Base workspace because sharing information between Appdesigner and Simulink is a pain in the whatsit. I am using a work-around by constantly (and probably over-using) 'assignin' and 'evalin'. I have read somewhere that this is not good practice, but I don't care because it makes everything work for me.
8) I really, really hate trying to use (or reading about certain functions) which work perfectly well in MATLAB, but are not yet implemented in Appdesigner e.g. annotations on plots, locating the cursor position.... which leaves me trying to create a new workaround.
9) When I started using Appdesigner, there was the promise from the MATLAB team that it would be possible to integrate different apps. to get them to work together. So my work started as a group of separate apps that I planned to pull together on the web. But that facility has not materialised and so I have needed to spend a lot of time pulling all my work into one app.
10) 'Copy and paste' occasionally grinds to almost a halt and then I have to shutdown MATLAB and start up again.
11) The 'Open' feature doesn't always update with all the files that are available - I can see them if I use 'Finder', but can't see them from Appdesigner 'Open' on every occasion - unless I shutdown MATLAB and re-start it.
12) If I report an issue, quite often I am asked to send a copy of my App. But this is not possible because the work I am doing falls under a form of confidentiality/privacy agreement. The alternative is to spend time trying to create something new to send to the MATLAB team, but I just don't have the time to do that, I am already working to a deadline. The net result is that they just close the file and don't seem keen to investigate themselves much further, which is disappointing.
I am keen to know if other people have experienced any of the problems I have seen (the ones that have not already been mentioned by others) because I sometimes wonder if it is just me and I have accidently done something in the wrong way, or been staring at the screen for so long that I have imagined it....
Salim Mansour
Salim Mansour on 10 Nov 2021
I have the problem of the app being slow as well, but only in the compiled version that is running as a stand-alone app on some device (test receiver).
In particular, I have an app developed in App Designer (2.8k lines & 17 callbacks, qutie small), and whose target is to query some data from the receiver, process them based on some user-inputed parameters (digital demodulation), and display the demodulation performance in axes (e.g. a consellation or an IQ vector diagrams).
The wierd thing is that when I run the app from desktop (and retrieve the data from the receiver remotely via TCP/IP), the app runs smoothly. I change some parameters and the app updates the diagrams in a relatively small delay, or say nigligibally compared to the next scenario (app running on device itself).
Then, when I take a copy of the compiled version to run from the device, which is having even better CPU resources than desktop or comparable, I can clearly notice delays in the constellation diagrams (i.e. the program halts) when updating some parameters of the app. Some can reach up to one minute, which is not acceptable for a "real-time" app that needs to be almost instantanuously updated based on the receiver.

Sign in to comment.

Jonas Korndoerfer
Jonas Korndoerfer on 1 Apr 2019
Dear Joseph,
I experience the same issues as described by you (loading and saving code in the app designer takes minutes, major delays when typing in or copying code, etc...). I have the feeling that the performance got even worse after updating matlab from version 2017b to 2018b. My app has ~10.500 lines, ~45 functions, ~100 callbacks and more than 200 components. The compiled app runs very smooth and stable but working with the app designer is almost impossible right now... I would appreciate any improvement since I spent months building this app and I like the general concept of the app designer!
  1 Comment
Jessica Hiscocks
Jessica Hiscocks on 1 Apr 2019
I've managed to speed up the app designer by splitting off a lot of sections of my code to independent functions, and calling them from within the app. It's still not great, but it's usable again.

Sign in to comment.

Paul Kane
Paul Kane on 19 Mar 2020
I have an App with > 1500 lines of code in R2018b and App Designer has become unusable due to this save problem. Love the concept of AD but the execution is poor. WIsh I had seen this coming before I started building the app. WIll try to refactor code into dependent functions but that's going to be a giant pain.

Melissa Williams
Melissa Williams on 19 Mar 2020
MATLAB R2020a, available today, has some great performance improvements to the App Designer coding experience. Check them out in the release notes. Select product->MATLAB and scroll down to the performance section and expand the App Designer Code View section.
Rik on 4 Aug 2021
As you might infer from this thread, I personally don't use either.
I care about the comments and coding style, because I think anything worth making is worth maintaining.
I don't know what causes the performance difference between 'normal' figures and uifigures. They are different types of objects, so it isn't surprising there is a difference. From the perspective of someone who doesn't use AppDesigner it looks like uifigures are more suited to web use with a smaller back-end. That is mostly speculation though.

Sign in to comment.

Paul Kane
Paul Kane on 20 Mar 2020
Thank you for your response. My company does not yet have a license for 2020a, but I was able to upgrade as far as 2019a. My problem is not performance per se, but rather that AD hangs when I am trying to save, and no matter how long I wait there is no recovery other than killing Matlab, restarting, and losing work. So far things seem a bit better in 2019a. I had gotten to the point in 2018b where I was unable to make and save further changes to this app - at all. I am revamping the app and putting as much code as possible into "helper functions" to cut down the number of lines in the .mlapp file. My app has gone through a lot of revisions, and I have a suspicion that deleting and adding components is part of the problem, in case your team wants to look into that. I do like AD very much and will continue to use it carefully.

Hadass Inbar
Hadass Inbar on 25 Mar 2020
Using the newswet 2020a realease and still running into the issues mentioned above.
  1 Comment
Dawid Strzelczyk
Dawid Strzelczyk on 15 Apr 2020
The same here. My app has only 600 lines of code and it is already painfull to work on it.

Sign in to comment.

Stephan Piotrowski
Stephan Piotrowski on 20 Jan 2022
I made a very simple example app as part of a feature request consisting of 2 UIAxes with a context menu. Launching Matlab 2021b off a fresh reboot, the app takes ~10 seconds to launch (not a huge problem). The insane thing is that the context menu takes ~8 seconds to open after right clicking the UIAxes the first time. It improves after the app has been open for longer (or maybe it's just after loading the context menu for the first time). Seems crazy for such a simple app to run so slowly, though.
  1 Comment
Mark Magdaleno
Mark Magdaleno on 20 Jan 2022
App designer has been and seemingly still an extremely obnoxious tool to use. I have avoided App Designer completely (as of 2 years ago) as I see no recognition of the issue from Mathworks in any meaningful way. Over the years I have tried and tried to make the best of it on many occasions only to realize that with all the window dressing, lipstick and rouge, its still a pig at heart.
App designer needs to be issued with a "bang head here" placard for your nearest wall.
App Designer, where GUI design bliss goes to die.

Sign in to comment.

Melissa Williams
Melissa Williams on 18 Jan 2019
Hi Joseph,
Would you be willing to reach out to tech support and send us a copy of your app and let us know which version of MATLAB you are using. There were some scale challenges with early releases of App Designer with large apps (R2016a) but those were mostly related to typing in the editor and have been improved release over release. I am not aware of issues related to severe slowness saving and running large apps. We do test for scale and yours would fall into our large app case, we are aware of other customers successfully using App Designer to build apps as large as yours. If you are able to provide your app the team may be able to get more insight into what is happening.
Mark Magdaleno
Mark Magdaleno on 30 Dec 2019
I have seen this problem for many years now with no solution in sight as each version of MATLAB is introduced despite the warning that Guide will go away. I have previosly avoided App designer but now it seems it will be forced upon us. Guide for me is/was a much better trade off. App designers window dressing comes at an unacceptable cost. Given that Guide is slated to go away I have since taken to only using App designer as a skeleton and have all code called from a class or other m scripts, as alluded to above.
Some issues with App designer still persist though;
- For SVN the appdesigner "code" is not stored as readable ascii so you cannot diff with previous checked in version.
- Using the Find Files utility will not search in the app designer code.
- UItables can be obnoxiously slow for user input as compared to Guide
- General user and designer experience compared to Guide is still noticeably slower despite offloading code to scripts/classes.
- Given the slow response time I find myself always stumbling through App/code design.

Sign in to comment.

Mark Magdaleno
Mark Magdaleno on 26 Mar 2020
Provide examples also please. Guide vs Appdesiner.

Mattias Arlbrant
Mattias Arlbrant on 6 Dec 2021
I am using 2020b and a 8500 line mlapp (just control code, most computational code is located in classes), and I can confirm that the AppDesigner performance is very disappointing, both of the editor and the mlapp applications. Especially graphics rendering in UIAxes makes our application almost unusable. It would have been good to know that app designer does not scale before starting this multi-year project.
Some might say "Why not upgrade to the latest version then?" The sad answer is because it is too risky. There are always big promises of improvements, but often the opposite happens (see for example comments above regarding 2021a). Also, the mlapp sluggishness issues have been around for years, it is clear that Mathworks does not prioritize them. Consequently I am extremely careful not to upgrade too early. Simply cannot risk losing time and wrecking the project.
IMHO, Mathworks should really concentrate on making the promised functionality work instead of pushing out buggy new features.
Mattias Arlbrant
Mattias Arlbrant on 6 Dec 2021
Thanks for your reply. I always use the profiler. The bottlenecks are unfortunately not in my code.
A tip regarding classes, it is important to be aware that access to member variables is very slow. For example, if you have a loop inside a member function of a class, and you access member variables from inside the loop, you can speed up the exection enormously by copying your member variables into local variables and using those local variables inside the loop.

Sign in to comment.

Koenraad Van der Borght
Koenraad Van der Borght on 7 Jan 2022
I have had a lot of performance issues in the past with app designer (not wanting to save, extremely slow etc). My apps are all 15k+ lines and what I can recommend is (using Intel based PC's):
  1. make sure that your PC is up to date with all the latest updates (not only windows updates (running now on windows 11 enterprise) but also Intel updates etc...the whole lot and do not forget GPU updates ). This is dependant of your PC manufacturer also...some are better than others
  2. big apps run better on Xeon CPU's than on i-something CPU's (I use both so the difference is quite remarkable)
  3. Immediately update MatLab (running now on 2021b Update 2)
  4. VHD on M.2 runs faster than separate SSD's
  5. Save your work regurlarly, it will take a 5-10 sec (check the "busy")
  6. Do not hesitate to contact support, for my issues in R2020b and R2021a they provided very adequate and professional assistance
  7. Integration with .NET/Java etc runs smoothly




Community Treasure Hunt

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

Start Hunting!