rdavin

Some AF Timings

Discussion created by rdavin Employee on Oct 27, 2011
Latest reply on Nov 3, 2011 by MichaelvdV@Atos

I recently posted some timing info in another thread and gave incorrect data.  It seems that I once again fell victim to performance caching.  I was comparing formulas and custom data references to the PI Point DR, and it erroneously showed a custom data reference as being almost 4 times slower than the PI Point DR.  I am relieved to say this is not true.

 

Original thread: http://vcampus.osisoft.com/discussion_hall/development_with_osisoft_sdks/f/28/p/795/12795.aspx

 

Where did I go wrong?  It seems that I made a special check for a PI Point DR, and if found, I made a call to the RawPIPoint object to issue report some info.  Later when I issued the GetValues call, it went very fast.  That's because the overhead of invoking the RawPIPoint was already performed and not included in the GetValues timings.

 

I've now corrected that and I made my test case extremely simple or down-right trivial.  I'm not performing any UOM conversion or rounding of any number.  All I am doing is echoing another PI Point attribute.  It's so simple I even compared a VB.NET version to a C# version of the custom data reference.

 

Running on my laptop with AF Server 2.3.0.4048, my raw PI Point has 85265 values, all of them good.   The attribute with the PI Point DR is named 'Raw Temperature".  All my attributes are Single (Float32) with a UOM of degree Farenheit.

 

The echo Formulas are quite simple as well. One is called Formula-A. That would be A for 'As-is'. Keep in mind, I said this was all clean data. Every value tested was a good number. Let's face it, though: that would be rarely the case. Instead you need to pad the calculation with a badval check. Let's call this Formula-B, where B of for 'Badval Check'.

 

Formula-A:

 

A=Raw Temperature;[ A ]

 

Formula-B:

 

A=Raw Temperature;[if badval(A) then NaN else A]

Milliseconds to echo 85625 values Echo Test PI Point DR C# DR VB DR Formula-A Formula-B 1 1059 1142 1095 1668 2226 2 1067 1060 1086 1605 2228 3 1053 1059 1055 1595 2302 4 1031 1066 1098 1604 2194 5 1140 1069 1090 1621 2275 6 1069 1094 1066 1595 2243 7 1044 1044 1094 1653 2193 8 1004 1081 1196 1598 2199 9 1057 1057 1009 1864 2201 10 1061 1058 1055 1591 2217 11 1055 1077 1080 1592 2272 12 1065 1050 1067 1651 2206 Average 1059 1071 1083 1636 2230

Summary:

Echo Execution Duration Values Per Millisecond Method Milliseconds Factor(1) Rate Factor(2) PI Point DR 1059 1.00 81 1.00 C# DR 1071 1.01 80 0.99 VB DR 1083 1.02 79 0.98 Formula-A 1636 1.55 52 0.65 Formula-B 2230 2.11 38 0.47 (1) Smaller is better (2) Larger is better

All I can saw is, it takes a big man to admit when he's wrong, and I am such a big man.

 

Mea culpa!

 

 

Outcomes