- Lazy Loading: Instead of creating all components at startup, create them only when they are needed. This can significantly reduce the initial load time.
- Component Grouping: Group related components together and initialize them in batches. This can help in managing the load more efficiently.
App designer generated app freezes in function "createComponents(app)"
26 次查看(过去 30 天)
显示 更早的评论
Hi
I've written an application using App Designer with 100s of components. When I start the app it freezes during the build of the components in the App Designer generated function createComponents. This happens before my own code starts to execute. The way to avoid this freeze is to add a breakpont far down in the createComponents function. createComponents is called before registerApp and runStartupFcn is called. All the mentioned functions are generated before my own code start to execute and are generated by App Designer and are therefore grayed out which means I can't do any edits.
Is this freeze problem known to this community and is there a fix for this?
Is there any way for me to edit the App Designer generated functions? I would like to add a pause instead of a breakpoint as a possible way to solve the freeze in createComponents function...
I'm running Matlab R2022a Update 8.
Most grateful for your hints and tips
0 个评论
回答(1 个)
arushi
2024-8-8,8:59
Hi Magnus,
It seems like you're encountering a performance issue due to the large number of components in your App Designer application. This can indeed cause the app to freeze during the initialization phase. While you cannot directly edit the App Designer generated functions (createComponents, registerApp, runStartupFcn), there are a few strategies you can employ to mitigate this issue.Strategies to Address the Freeze Issue:
1. Optimize Component Creation:
2. Use a Timer to Delay Initialization or Use pause in Startup Function.
Hope this helps.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!