App Designer extremely slow to save and run

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

Kevin Chng
Kevin Chng on 17 Jan 2019
Edited: Kevin Chng on 23 Jan 2019
Try use guide or programming approach.
Through my experience, they are running faster than app designer with same application.
I exported the mlapp file to m-file and indeed editing the m-file is much faster and without lags. However, technical support told me that converting m-file back to mlapp file is not supported. Is this true? If so, then it appears the benefits of using App Designer are limited to small scale apps.
Kevin Chng
Kevin Chng on 18 Feb 2019
Edited: Kevin Chng on 18 Feb 2019
If you are only intended to build desktop application, the m file is acceptable by MATLAB compiler. I have done that before, I copied the entire code and paste them in m. file to edit and run for more customization. Last, I compiled it to desktop application.
However, i think m file is not accepted by web application (MATLAB Web App Server and MPS sever) change to ctf. file.
I don't have solution how to accerelate the app designer to make it not so lag. If you have experience with other UI designer (Android,java swing), they are also quite lag sometimes. Mac OS has the best rendering speed as what I heard.
I'm not sure that why among 3 of methods(App Designer, guide, programatic way), app designer is the slowest.
Yes, I'm quite sure that, when the code size is very large, app desinger seems to be extremely slow in contrast with GUI when executing the same code. So, although i really really like the app desinger interface a lot, i have to use Gui still for efficiency.
And i have another question, high resolution is not supported by app desinger ? cause it always shows to be blurry compared with Gui.
< MATLAB R2019a >
I'm using Appdesigner to build a software with 2000 lines of codes. I think it isn't complex.
At first, the codes run without appdesigner, and the speed is all right.
However, when running the interface, the code turns to be very slow, especially when drawing plots.
What's more, the app I packed need nearly 30 seconds to open, really.
I love Matlab for almost 8 years, it is a excellent tool, but the interface from GUI to Appdesigner seems need to be faster and better.
Hope for MATLAB R2019b.
I agree. Graphics rendering seems impossibly slow in app designer, much slower than GUIDE. Almost unusable as a deployed application.
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)

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

10 Comments

Ooh, another one...
13) The 'Undo' button in Appdesigner seems to wander off for a holiday, just when I need it most. Why does that happen ?
Hi Marco
I have had the same experience as you detailed. Another feature I noticed was when I recently, on a simple App, chose to use the built in Axes. The time it took to update the App Designer axes forced me to make the plots in external figures.
I have followed App Designer for about 7-10 years now and while some window dressing issues have improved, the speed thing remains a major Achilles heel of the "tool". With every new release I have held out hope that the speed issue would be fixed but this has not been my experience. This despite all these testimonials on this and other threads over the years.
My hope is Mathworks will keep GUIDE around for the foreseeable future and really give a more sobering look at App Designers impractical sluggishness when compared to most every other Mathworks tools.
As you note App Designer really doesn’t behave well with a lot of lines of code within the App despite this being noted many years and releases ago. When I do choose to use App Designer, out of fear GUIDE will disappear, I have taken to placing all callbacks out of the app into either m functions or a class. This helps on the editing and coding speed issues, however its still in my opinion not a solution for unacceptable user experience speed.
Mark
Thank you, Mark, that is interesting to hear/read about. I only started with GUIDE for about five minutes because I read about Appdesigner and like you, did not want to invest time and effort into something that was intended to be superceded. But now all my programming 'eggs' are in the Appdesigner 'basket', so I have to make it all work....somehow.
I agree with Mark's feedback, the generated app is too slow. I run an app that do webread requests and calculations and plot a chart and refresh it every 5s with a timer. On my local computer (Ryzen 3600), performance is fine. But trying to deploy it on a VPS (4 xeon CPU, 2GB ram) results in extremely high cpu usage and very poor performance - the framework seems to use a lot the CPU although my timer is OFF and the app does nothing excep waiting. I will export now my .m as DLL and use them in .Net application instead. And the framework is 2.4GB :(...
I saw a substantial improvement from 2020a to 2020b, but I upgraded to 2021a and it is terrible again. My apps are between 7,000 and 20,000 lines and working on them takes very long. It takes minutes for saving changes and the more you try to save it takes longer and even does not save anymore....renaming the app does not work either...
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.
Yes I have similar problem.
I migrated one old GUIDE app to Appdesigner, such a mistake.
I modify it, trying to optimize it. The App is taking data from a device with a raster scanning method for imaging (so a loop for each pixel of my object to scan). (>2500 lines of codes for this app with ~40 callbacks, not a very big app).
To take data this is such a pain, every loop, Appdesigner is just beeing slower, from 1sec for the first loop to collect and write data to 14s for the last loop... I am communicating to the device via TCP/IP protocol, but it looks like that this job is ok for matlab, but writing data in a file seems to be a pain for the AppDesigner.
I copy paste my code on a .m Matlab code, and everything is working well (only problem of .m is that you don't have the same and nice interface).
I will try to move everything on GUIDE, and hopefully Matlab will keep it. Or I will just move to python.
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.
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.
I am also having a similar problem. I have a very large App Designer application that "runs away". Right now Matlab is using 25% of the CPU and 1.7BG of memory for the last 10 minutes, and the app is minimized. I have tried sprinkling breakpoints in the code and have yet to hit one during this state. At the least, how can I find out what part of the code is running autonomously?

Sign in to comment.

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

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.
No, GUIDE's ability to create new GUIs has already been removed.
Crisp? I don't think that is the word I would use when describing something that generates at least double the code required, with comments that have been incorrect for years. Have you noticed how it describes the eventdata input for callbacks? You really have to try to find a release where it is actually true that it is reserved for future implementation.
I can understand it if you don't want to use AppDesigner, but singing the praises of GUIDE is not your only other option. I remain convinced you should only use GUIDE as a sketching tool or for GUIs you're only spending an hour creating and using.
As for sticking around: figures are not going anywhere any time soon. I think they would much sooner remove the option of implicitly closing functions. (GUIDE does not use the end keyword to close functions, which is fine as long as you don't want nested functions or want to combine a script with local functions)
By crisp is the time it takes to go from "0-60" not the amount of incorrect comments. App designer you can time "0-60" on a calendar. All aspects of Appdesigner (AD) are like slogging thru wet concrete. Will use not AD based figures for now as I now do not use Guide rather I roll my own stuff. This is even more desireable than using AD.
BTW what exactly is it about AD that makes it so slow?
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.

Using the newswet 2020a realease and still running into the issues mentioned above.

1 Comment

The same here. My app has only 600 lines of code and it is already painfull to work on it.

Sign in to comment.

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

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.

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

2 Comments

Try profiling your app, check where the execution time is the highest. I had issues with class implementations in general in MATLAB where running some code could take 30 minutes as opposed to the "more optimized" code which took 4 minutes.
Yes, UIAxes still has issues.
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.

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
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

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.

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

Hi Melissa,
I am currently in contact with MATLAB tech support regarding this issue. By posting my issue on MATLAB Answers, I was hoping to see whether other MATLAB users could attest to successfully editing and running Apps of this scale. The issue is related to saving AND typing in the Code View of the App editor.
Unfortunately, I cannot provide the App as it is considered proprietary. However, I recently received an example App from tech support with ~100 randomly created components and ~20 callbacks. Even in this smaller App, I experienced lags in typing. For example, if I copy text then try to paste elsewhere in the App, it can take more than 10 seconds to paste, or simply not paste at all.
I have similar issues, although not quite that bad. My code is ~6500 lines long. Like Joseph, I see very laggy behaviour from the app designer (2018b version). Some examples include a lag when copy/pasting, the app freezing for a few seconds (particularly when I'm typing and create syntax errors in the process of entering code), and most recently the Design view having issues generating new components by drag and drop (I had to drag them over twice before they showed up correctly).
I think a large part of the issue is that the error checking is too agressive. 'Enable app coding alerts' checkbox does nothing, I get them either way. The app designer is obviously constantly checking the code for errors, putting a huge load on the system. It would be far better to have an option to turn this off for large apps, and just flag them when 'run' is pushed, or even have it wait for 60s after typing is done to allow the user time to finish entering a code segment before checking it.
Thanks for your comment Jessica. I am glad to hear my experience is not unique, though of course not glad that this problem seems to be common for large apps. I have ran the profiler while performing a few operations on an App provided by technical support, with several hundred randomly created components. I ran the profiler then added a callback and a few lines of code and saved the app, and sent the profle info to technical support (zip file attached). They recognize that most of the execution time is spent in overhead tasks but have not have not provided any solutions beyond exporting to m-file. There is an option to easily export the mlapp file to m-file, such that the m-file can be edited without any of the lags experienced in App designer. However, I was told that it is not possible to convert the edited m-file back to an mlapp file, so going this route is essentially abandoning the mlapp file and App Designer altogether.
I also experience error checking even if 'Enable app coding alerts' is unchecked, and think this is a major problem. Additionally, there should be option to turn off the suggestions in completing lines of code, as the m-file editor does not offer this and I wonder how much this contributes to the lag.
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.

Provide examples also please. Guide vs Appdesiner.

Products

Release

R2018b

Asked:

on 16 Jan 2019

Commented:

on 12 Jul 2022

Community Treasure Hunt

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

Start Hunting!