GUI profiler: slowest at FileOpenCh​ooser.doSh​owDialog

I am making a fairly large GUI (not a whole lot of data, but different GUI screens and a lot of tables, buttons, etc.), and as I add more functionality, it just gets slower and slower. I just ran the profiler, and the highest "self-time" section was FileOpenChooser.doShowDialog at 9.062s. I wonder what might be the cause for this - is it just the amount of GUI buttons and tables that I use? I'm not sure what information I can provide to help further on here.
As a note, I'm a bit confused about using the uitabs (so I'm not currently doing that),but I like using GUIDE since there are so many parts to the GUI, so I can set it up visually which I like. As the GUI is now, it's like a poor version of tabs. Based on what configuration the user seects, a different set of uipanels will become visible, so when I see the GUI in guide, it's just all the uipanels overlapping. I realize this is not good. I'd like to be able to use guide to make my different screens for the user in a more efficient way, but I'm just not sure what the best method is.I don't want one GUI to close and another to open -- it should be a seamless transition.
Sorry this is sort of a ramble. Any input would be appreciated.

5 件のコメント

Geoff Hayes
Geoff Hayes 2014 年 7 月 10 日
Katerina - when you say that it just gets slower and slower do you mean when the GUI performs certain functions (say in response to a push button) or moving from one "tab" to another or ..?
You could always attach your m file and fig file (to your question using the paperclip button) so that others could try to reproduce the same behaviour and/or provide comments on its construction.
katerina
katerina 2014 年 7 月 10 日
Sorry -- by "slower and slower" I meant that after adding more GUI features and then running it, it is much slower than with less features. I realize this is pretty intuitive. I don't think I can attach all my files on here since it's for my work (not sure of the policies), but my data management has not changed -- only the size of the GUI itself. I'm considering making some changes like grouping some of my radiobuttons to the same callback functions instead of them all being separate, but I'm not sure how much of an impact that will make, besides bringing down the code size.
I hope this answer is helpful for your thoughts. Thanks.
Jan
Jan 2014 年 7 月 10 日
@katerina: Is the opening of the GUI slower or does the processing slow down?
Geoff Hayes
Geoff Hayes 2014 年 7 月 11 日
@katerina: how many widgets (roughly) are a part of your GUI, and how many lines of code in the m file? (Since you can't attach the code.)
katerina
katerina 2014 年 7 月 11 日
@jan: it's slow to open! thanks for asking. the processing is not bad.
@geoff: After cutting out ~300 lines by combining radiobutton callbacks, my total program length is (rough estimate) ~1200 lines with 10 function files, and the GUI has maybe 60 radiobututtons/checkboxes,7 tables, and a few other things, including some listboxes. At some point, I will either be making this an App or compiling it to be a standalone program. I wonder if this minor slowness will be fixed when one of those happens?

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

回答 (1 件)

Robert Cumming
Robert Cumming 2014 年 7 月 11 日
編集済み: Robert Cumming 2014 年 7 月 11 日

0 投票

This could be misleading as the time (FileOpenChooser.doShowDialog) also covers the time it takes the user to select the file and then select okay.
Your gui may be slow if you have lot and lots of objects, including ones that are hidden or not been deleted properly.
Does restarting Matlab speed it up again (if so you have the equivalent of a memory leak and objects are not getting cleared/cleaned up properly).
Try:
objs = findobj ( 0 );
set(0,'showhiddenhandles','on');
allObj = findobj ( 0 );
this will show how many objects matlab knows about.
If you close your gui the number should return to 0.

3 件のコメント

katerina
katerina 2014 年 7 月 11 日
Hi Robert, Thank you for your input. Restarting MATLAB does not speed up the program again. I ran your lines and then ran the program, but they still show zero. Are there any other commands I should use here?
Thanks!
Robert Cumming
Robert Cumming 2014 年 7 月 11 日
Run the lines again when the gui is alive and again after you close the gui.
katerina
katerina 2014 年 7 月 11 日
okay, the numbers did return to 0 after the program closed (thank god).

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

カテゴリ

ヘルプ センター および File ExchangeInteractive Control and Callbacks についてさらに検索

質問済み:

2014 年 7 月 10 日

コメント済み:

2014 年 7 月 11 日

Community Treasure Hunt

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

Start Hunting!

Translated by