App Designer updates much (20x) slower than GUIDE

56 visualizzazioni (ultimi 30 giorni)
Bramvg
Bramvg il 5 Mar 2020
Commentato: Brian Kardon il 18 Ott 2022
With App Designer I made an application that gets an image from a camera and after some processing displays it in a GUI. The problem is that it is extremely slow. It turns out this is due to the slow updating in the uifigure (using drawnow).
Below is a simple script to reproduce the problem. The script plots an image and a button, which calls a function that updates the image. The script does the same thing twice, once using uifigure (App Designer) and once using figure (GUIDE).
example_script.m:
close all hidden
clear
clc
%% app designer example
figure1 = uifigure('Name','UIFigure 1');
figure1.Position = [100 100 500 400];
axes1 = uiaxes(figure1);
axes1.Position = [50 50 400 300];
im1 = imagesc(axes1,rand([1280 1024]));
button1 = uibutton(figure1,'push');
button1.Position = [20 370 150 22];
button1.Text = 'push to refresh!';
button1.ButtonPushedFcn = {@buttonpushed,im1};
%% guide example
figure2 = figure(2);
figure2.MenuBar = 'none';
figure2.Position = [700 100 500 400];
axes2 = axes(figure2,'Units','pixels');
axes2.Position = [50 50 400 300];
im2 = imagesc(axes2,rand([1280 1024]));
button2 = uicontrol(figure2,'Style','pushbutton');
button2.Position = [20 370 150 22];
button2.String = 'push to refresh!';
button2.Callback = {@buttonpushed,im2};
%% callback function
function buttonpushed(~,~,h)
tic
im = rand([1280 1024]);
h.CData = im;
drawnow;
toc
end
The timing results from tic/toc in the callback function, for my computer and Matlab R2018b are:
  • For UIFigure 1: Elapsed time is 0.872563 seconds.
  • For Figure 2: Elapsed time is 0.042053 seconds.
(These timings are reproducible.) This is a factor 20 difference! And this means the difference between a snappy and an extremely sluggish GUI. The same performance difference is visible while loading the script.
Is this normal behavior or am I doing something wrong?
  2 Commenti
Kevin S
Kevin S il 29 Ott 2021
I am also finding that App Designer is abysmally slow compared to GUIDE. I really hope they address this as App Designer is pretty much unusable in its current state.
Brian Kardon
Brian Kardon il 18 Ott 2022
I have been forced to go back to GUIDE because of how slow and buggy AppDesigner is. I hope they don't remove GUIDE until AppDesigner achieves at least parity with GUIDE in terms of performance and usability.

Accedi per commentare.

Risposte (1)

Steven Lord
Steven Lord il 5 Mar 2020
Try calling
drawnow limitrate
instead of
drawnow
with no inputs.
  5 Commenti
Mark Magdaleno
Mark Magdaleno il 10 Gen 2021
App designer is obnoxiously slow compared to guide particularly if your app is larger than a hello world app. It has been this way for uncountable releases and it seems there is no recognition of this elephant in the room.
Also the uitable in app (crap) designer compared to Guide is jaw dropping interms of slowness and users editng a cell. The model to go after would be Guide which behaves very much like an Excel spreadsheet interms of cell editing. In app designer the user has to make a very conscious clicking of the cell in and App designer uitable which is unlike Excel and Guide and is highly error prone for the end user. For example to edit a cell in a table in excel or Guide one simpley clicks with the mouse and types the value and it appears as typed. Not so with app designer as the existing value is prepened on the new values entered by the user. The user has to first click then some how select the entire contents or backspace then enter the new values. Absolute garbage.
Peter
Peter il 29 Apr 2021
On Linux, this is even more ridiculous.
Using the script above, I get the following numbers, which are absolutely inacceptable.
Elapsed time is 0.106374 seconds. % guide
Elapsed time is 18.838314 seconds. % appdesigner, may vary from 4sec to minutes...
And sometimes it blocks even for minutes, blocking all other matlab windows either. I am running Matlab R2020b on Ubuntu 20.04 on a 16 core machine via a remote X-connection on a local network.
If I run it on the local graphic display, things look at first glance more promising:
Elapsed time is 0.02 seconds. % guide, when pressing the button more than once
Elapsed time is 0.05 seconds. % appdesigner, when pressing the button more than once
but the confusing thing is, that alternately pressing the buttons leads to quite unpredicatble update times ranging from 0.2 ... to several seconds.
On a more complex appdesigner Application I observed, that keyboard input in tables on Linux did not work although it worked on Win.

Accedi per commentare.

Categorie

Scopri di più su Migrate GUIDE Apps in Help Center e File Exchange

Prodotti


Release

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by