UI graphics objects taking several minutes to update when running App Designer application, can I speed this process up?

1 次查看(过去 30 天)
My application uses an app.Button to execute approximately 80-90 lines of code for importing data from a spreadsheet. I have learned that the import code within the ButtonPushed(app, event) function itself runs very quickly (1.5-2 seconds), but for the UI of application to update (app.EditTextField, and app.ListBox.Items being updated) with the newly imported information takes over two minutes.
I have pinpointed the slowdown using the profile on, profile viewer, functions (see images below), but don't have a strong enough programming background to interpret. Can anyone advise on how to potentially improve the update speed of my application graphics?
ProcessDTS_Snip4.PNG
ProcessDTS_Snip6.PNG
ProcessDTS_Snip5.PNG

回答(2 个)

Harsha Priya Daggubati
Hi,
It would be more helpful if you could provide information about what type of data are you trying to load into AppDesigner. One guess would be you are loading a very large numeric data loaded. If that's the case, you try simplifying the data by assocating an id with real data to avoid processing the whole lot of data.
Hope this helps!
  2 个评论
AdamG2013468
AdamG2013468 2019-8-8
Your assumption is correct. I am loading a large .csv file with 15 columns of numeric data and a relatively small amount of header information (43 MB file) using the fopen and textscan functions.
As I mentioned before, the code within the ButtonPushed callback function takes a small amount of time to run according to the tic toc functions (~1.5 seconds), but while watching the actual application window, the EditTextField.Value, Lamp.Color, and ListBox.Items don't update for about two minutes of waiting.
AdamG2013468
AdamG2013468 2019-8-8
According to the above images, what seems to be taking so long is converting from MATLAB numerical values to Java Values. Would the only way to speed this up be to try converting to a more manageable data type, such as singe instead of type double (i will try this in the meantime)?

请先登录,再进行评论。


Harsha Priya Daggubati
It would be helpful if you can share the MATLAB Code and the type of data you are loading from spreadsheet. As you mentioned that you are updating EditTextField.Value, Lamp.Color, and ListBox.Items, I think none of those properties accept a numeric value with 15 columns.Also, edit field value and listbox items only accept char array/cellstr and Strings.
  1 个评论
AdamG2013468
AdamG2013468 2019-8-15
The code would take quite some time to copy considering it is saved on a seperate non-networked computer. What more would you like to know about the spreadsheet data? The spreadsheet is 300178 X 16 elements with numerical data in the format 0.000000. After some investigating, the line of code that is taking the longest time is simply:
app.ActiveChannelsListBox.ItemsData = RawData(1, 2:end);
Where RawData contains the numerical spreadsheet info described above. There may simply be no way of speeding this up.
Again, the code runs perfectly fine with no errors, it just takes longer than I would expect it to.

请先登录,再进行评论。

类别

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

标签

Community Treasure Hunt

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

Start Hunting!

Translated by