AnsweredAssumed Answered

Performance issues getting values from pre-loaded elements

Question asked by JosephHanvy on Mar 30, 2016
Latest reply on May 10, 2016 by JosephHanvy

I'm getting some AF data but I'm finding significant performance issues. I'm not dealing with many objects, at the moment I'm fetching 63 AFElements, each with 8 AFAttributes.

 

The function takes over 8 seconds (which is never going to be acceptable for the UI), almost all of which is spent getting values from Attributes. I found the lazy loading was causing issues with it calling the server every time I accessed the AFAttributes, so I added pre-loading:

 

var elements = AFElement.FindElements(AFDatabase, searchRoot, "*", null, MyElementTemplate, AFElementType.Any, true, AFSortField.Name, AFSortOrder.Ascending, 200);
AFElement.LoadElements(elements);

 

This reduces the RPC to two, instead of my 1 + 63 I had before:

 

RPC Metrics
   AdvancedFindElements: 1 calls.  292 ms/call on client. 8 ms/call on server.  Delta: 285 ms/cal 1

Total RPCs: 1

 

Yet it still spends 8 seconds of the method on this line (63 times):

 

AFAttributeList attributes = new AFAttributeList(element.Attributes);
AFValues values = attributes.GetValue();

 

This can't be normal can it? Is this the best performance I'm going to get?

Outcomes