Question: Why is main thread blocked by Model.prototype.refresh() so long?
See original GitHub issueOpenUI5 version: 1.56.18 (legacy app here, sorry)
Browser/version (+device/version): Firefox 102.0 (64-bit), Linux (Arch)
Any other tested browsers/devices(OK/FAIL): -
URL (minimal example if possible): -
User/password (if required and possible - do not post any confidential information here): -
Steps to reproduce the problem:
- We use two-way data binding heavily
- destorying or updating controls takes very long and completely blocks the main thread
What is the expected result? Adding and destroying aggregations should not take long and should not block the main thread for long (see: Firefox Profiler “Jank - event processing delay”).
What happens instead?
We see many seconds of browser main thread freezing when calling this.getView().getModel().refresh(true);
.
The same applies to destroying the view.
We see a lot of bindings being attached and removed (see screenshot).
I understand that we use a fairly old version of openui5. Nonetheless I would like to ask if anybody has ever seen a performance issue like the one depicted by the flamegraphs below. I do not understand whether we are misusing the framework somehow or whether this is a bug that was already fixed by newer openui5 versions. Any hint on what might be going on is highly appreciated! =)
Any other information? (attach screenshot if possible)
Destroy:
Update (setProperty -> refresh JSONModel):
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Ok, now I have many questions. 😄 You can DM me on OpenUI5 Slack and maybe we can take a look at the application together. Let’s close this issue for now since Issues are only for bug reports
Well, that makes sense! Thanks for the hint and the link! =)
Do you know what is the the fastest and/or recommended way to destroy all controls when the model changes? When we update the data, we basically reload all the data in the mode, i.e. every single property is set with fresh values.
Is there a way to efficiently destroy the old controls and re-render the view? We currently always do
model.refresh(true)
when a new model is to be rendered.