AFAttributeList.GetValue() time-effiency when attributes involved are not Pi Points

Discussion created by IPCOSRumaila on May 16, 2014
Latest reply on Aug 11, 2016 by arm77



we are facing serious time-efficiency problems when accessing PI/AF. We are building web-applications, which we want to be very responsive. Unfortunately our AF-tree is quite large > 25000 elements and traversing part of the tree and get the value for attributes given a time-stamp takes way to long (60 seconds and more).


The first culprit was traversing the the AF-tree . We were able to tackle this by caching the elements we need in advance and keep the cache alive in the webservice. Now traversing the tree is very quick: ( 120 milliseconds).


But getting the values for the attributes seems to be difficult to optimize. We use quite a lot of Custom data References. These Custom Data References fetch values from a database. Unfortunately each getValue results into a round-trip to the database which is performance killing.   The AF SDK manual advices to use AFAttributeList.GetValues() to avoid this, but I think this will only work for attributes refering to PI Points? 


Is there some hook we need to implement to let  AFAttributeList.GetValues(), perform fast, also in case of Custom Data References?  Any other advice on this?