Qlik Community

Qlik Sense Integration, Extensions, & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

Announcements
QlikWorld, June 24-25, 2020. Free virtual event for DI and DA gurus. Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Partner
Partner

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

 

1 Solution

Accepted Solutions
Highlighted
Employee
Employee

Re: IGenericObject.GetLayoutAsync() behavior on large objects

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
Highlighted
Employee
Employee

Re: IGenericObject.GetLayoutAsync() behavior on large objects

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

Highlighted
Partner
Partner

Re: IGenericObject.GetLayoutAsync() behavior on large objects

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!

Highlighted
Partner
Partner

Re: IGenericObject.GetLayoutAsync() behavior on large objects

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!