App Designer extremely slow to save and run
251 views (last 30 days)
I am developing a MATLAB App using App Designer and the program has become extremely slow. Problems that I have include the following:
- Delays upto several minutes long between clicking "save" and the program actually saving, as denoted by removal of the asterisk after the file name.
- Delays of many minutes after hitting "run"
- Delay of many seconds when trying to paste copied text.
- Inconsitency or inability of pasting copied text to the point where text is pasted in unintended part of code
- Delays in removal of error messages when adding conditional statements
- 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.
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 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....
Jonas Korndoerfer on 1 Apr 2019
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!
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.
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 on 25 Mar 2020
Using the newswet 2020a realease and still running into the issues mentioned above.
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.
Melissa Williams on 18 Jan 2019
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.
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.
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):
- 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
- big apps run better on Xeon CPU's than on i-something CPU's (I use both so the difference is quite remarkable)
- Immediately update MatLab (running now on 2021b Update 2)
- VHD on M.2 runs faster than separate SSD's
- Save your work regurlarly, it will take a 5-10 sec (check the "busy")
- Do not hesitate to contact support, for my issues in R2020b and R2021a they provided very adequate and professional assistance
- Integration with .NET/Java etc runs smoothly