Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
catalin
Partner - Contributor III
Partner - Contributor III

IGenericObject.GetLayoutAsync() behavior on large objects

Hello, dear Qlikers!

I am experiencing a rather odd behavior of the interface's IGenericObject GetLayoutAsync() function. It hangs and freezes while trying to calculate some heavy-duty tables. 

What I do is iterate through some list of sheets and get their children and for each, I call GetLayoutAsync() function. 

Is there something that I miss? The strangest thing is if I have multiple sheets to be calculated, that specific sheet which yields a timeout when is ran alone, it works. 

The server also have some other heavy-duty tasks which put some pressure on the I/O and memory. It could make this process of pre-loading objects to timeout?

Private Sub CalculateObjects(ByVal app As IApp, ByVal location As ILocation, ByVal id As IAppIdentifier)
For Each sheetid In sheetids
                Dim obj As GenericObject = app.GetObject(Of GenericObject)(sheetid)
                Dim copii = FindAll(app, obj)                
                Dim tasks = children.[Select](Function(o) o.GetLayoutAsync()).ToArray()
                Task.WaitAll(tasks)               
Next
End Sub

Private Function FindAll(ByVal app As IApp, ByVal obj As IGenericObject) As IEnumerable(Of IGenericObject)
            Dim copii As IEnumerable(Of IGenericObject) = obj.GetChildInfos().[Select](Function(o) app.GetObject(Of GenericObject)(o.Id)).ToArray()
            Return copii.Concat(copii.SelectMany(Function(copil) FindAll(app, copil)))
End Function

 

Labels (5)
1 Solution

Accepted Solutions
Øystein_Kolsrud
Employee
Employee

The engine is a complicated beast... Is there a particular object for which the layout calculation is expensive?

One potential reason why you get a different behavior when computing multiple sheets compared to just one is that some of the calculations required for the expensive sheet have already been calculated as part of the previous sheets. You could test this by seeing if you get the same behavior if you just reorder the sheets so that the expensive one comes first.

View solution in original post

3 Replies
Øystein_Kolsrud
Employee
Employee

The engine is a complicated beast... Is there a particular object for which the layout calculation is expensive?

One potential reason why you get a different behavior when computing multiple sheets compared to just one is that some of the calculations required for the expensive sheet have already been calculated as part of the previous sheets. You could test this by seeing if you get the same behavior if you just reorder the sheets so that the expensive one comes first.

catalin
Partner - Contributor III
Partner - Contributor III
Author

Yes, there's a table which triggers heavy-crunching. But your idea is very good, I will put that particular sheet first. Will come back with the results. Else I guess more processors added to the license. Our server is licensed by core.

Tks alot!

catalin
Partner - Contributor III
Partner - Contributor III
Author

I did the test. It behaves as you said. Seems that the previous objects being loaded actually were a warmer, given the fact that contained some calculations that are being present in the timeout-ish sheet, for that big object.  Well, it's not a problem to keep it after the first two sheets. I guess it's a little bit cheaper than having new logical processors licensed. :))

Tks for the tip!