PointList enumerator is slow

Discussion created by belous3 on Oct 10, 2013
Latest reply on Oct 18, 2013 by belous3



I encountered problem that there is not possibility to quickly iterate over the existing PointList and get all point names.


Simple iteration on all PIPoint in the PointList takes 2x more time than calling ArcValue on the same list.


Example C# code:


            foreach (PIPoint pv in plist)


For 12000 points it takes about 30 seconds to complete.


Second example:


            PointValues vals = pl.Data.ArcValue(time, RetrievalTypeConstants.rtAtOrBefore, out errors);
            foreach (PointValue val in vals)
                tagVals.Add(new TagValue() { name = val.PIPoint.Name, value = val.PIValue.IsGood() ? val.PIValue.Value.ToString() : null });


For same 12000 points it takes only 13 seconds to complete.


Currently I am in situation when it is quicker for me to call ArcValue first and iterate over PointValue list but it is not normal. Can anybody advice more optimal way to perform this task?