App spends a lot of time calling ToolbarController and similar

1 次查看(过去 30 天)
I am building a small app using Matlab's App Designer. This app displays plots, listboxes and other interactive elements.
To solve a small slowdown issue I recently used Matlab's profiler, I was able to solve my issue but in the process I also noticed that during operations, that I expect the user to do often, the app spends a lot of time (>50%) calling subfunctions that seem to be related to axis toolbars, such as ToolbarController, WebToolbarController, AxesToolbar etc:
Here, the blue bars on the left represent code I understand and expect, the pile of grey bars on the right are unexpected.
I am wondering why this is happening? I am also suprised by this because I have disabled toolbars for my app axes (in App designer, under interactivity > toolbar.visible is unchecked) so the app should not really need to spend time dealing with toolbars at all.

回答(1 个)

Karanjot
Karanjot 2024-3-23
Hi,
It's interesting that you're experiencing unexpected performance issues related to the axis toolbars in your MATLAB App Designer. Even though you have disabled the toolbars in the App Designer, there might still be underlying processes related to the toolbars that are affecting the performance adversely.
To investigate further, I suggest you to check if there are any callbacks or functions in your code that are indirectly interacting with the toolbars. Sometimes, even if the toolbar is disabled, certain operations or functions can still trigger toolbar-related processes.
Additionally, Review your code and make sure that you are not inadvertently calling any functions or performing operations that are related to the toolbars. Look for any unintentional interactions with the toolbar-related classes you mentioned (e.g., ToolbarController, WebToolbarController, AxesToolbar).
Since App Designer is built on top of MATLAB's graphics system, so there might be underlying processes related to the toolbars that are still being executed, even if they are not visible in your app.
  1 个评论
Neurolab
Neurolab 2024-3-25
I agree, but how do I know if an operation calls functions related to the toolbars?
If you look at the output of the profiler, there is no parent function listed for the toolbar functions, I don't know why they are being called...

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Develop Apps Using App Designer 的更多信息

产品


版本

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by