MATLAB Answers

App Designer extremely slow to save and run

268 ビュー (過去 30 日間)
Joseph Smalley
Joseph Smalley 2019 年 1 月 16 日
コメント済み: Marco Frieslaar 2021 年 3 月 23 日 14:34
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 件のコメント
Mario Malic
Mario Malic 2020 年 11 月 16 日
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.

サインインしてコメントする。

回答 (10 件)

Melissa Williams
Melissa Williams 2020 年 3 月 19 日
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.
  1 件のコメント
Mark Magdaleno
Mark Magdaleno 2020 年 3 月 20 日
Any chance we can get assurances that Guide will stick around until Appdesigner is shown to have fixed all of its issues. I am now using 2020A and with one of my Apps the time it takes to fully "materialize" went from 30 seconds on 2019B to 20 seconds in 2020A. Better but still obnoxious to my users (ask me how I know this). Guide has proved itself to be very crisp. Appdesigner 2020A so far seems a little better but still overly sluggish, but note I have very limited seat time with it. I will play with it furthur and have those users of the one App, which I made the unfortunate choice to code in AD, reinstall the 2020A run time library and the 2020A compiled app.

サインインしてコメントする。


Melissa Williams
Melissa Williams 2019 年 1 月 18 日
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 件のコメント
Mark Magdaleno
Mark Magdaleno 2019 年 12 月 30 日
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.

サインインしてコメントする。


Jonas Korndoerfer
Jonas Korndoerfer 2019 年 4 月 1 日
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 件のコメント
Jessica Hiscocks
Jessica Hiscocks 2019 年 4 月 1 日
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.

サインインしてコメントする。


Paul Dirac
Paul Dirac 2020 年 1 月 15 日
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.

Paul Kane
Paul Kane 2020 年 3 月 19 日
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 2020 年 3 月 20 日
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 2020 年 3 月 25 日
Using the newswet 2020a realease and still running into the issues mentioned above.
  1 件のコメント
Dawid Strzelczyk
Dawid Strzelczyk 2020 年 4 月 15 日
The same here. My app has only 600 lines of code and it is already painfull to work on it.

サインインしてコメントする。


Mark Magdaleno
Mark Magdaleno 2020 年 3 月 26 日
Numbers please
Guide vs AppDesigner???

Mark Magdaleno
Mark Magdaleno 2020 年 3 月 26 日
Provide examples also please. Guide vs Appdesiner.

Marco Frieslaar
Marco Frieslaar 2020 年 4 月 30 日
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....
  6 件のコメント
Marco Frieslaar
Marco Frieslaar 2021 年 3 月 23 日 14:34
I'm always quite childishly excited about a new release because I stupidly hope that there will be an increase in speed and/or some new helpful feature or bug fix. But with 2021a, I had to stop using it almost straight-away because there was a fault with setting the path, so I have switched back to 2020b. Sometimes the time wasted in searching forums to see if there is a fix is just not worth the time and effort when you have more pressing work to get done.

サインインしてコメントする。

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by