MATLAB Answers

App Designer extremely slow to save and run

240 views (last 30 days)
Joseph Smalley
Joseph Smalley on 16 Jan 2019
Commented: Rik on 4 Aug 2021
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.
  7 Comments
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 (9)

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.

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.
  5 Comments
Rik
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.


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....
  8 Comments
Marco Frieslaar
Marco Frieslaar on 4 Aug 2021
I appreciate hearing about your woes, Cyril because then I know that it is not just me and I am not being completely delusional. Thank you.

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.
  4 Comments
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.


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.

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.


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

Products


Release

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by