3 Replies Latest reply on Feb 23, 2017 4:34 PM by Rick Davin

    Efficiency of path searches

    Hakon.Bjorlykke

      While reading some papers and presentations on search methods, I discovered a contradiction regarding the recommendation of using path searches. The presentation Optimizing PI AF Server and PI AF SDK Applications for Performance and Scalability from 2013 rates path searches as best practice (slide 76), after improvements performed in AF SDK 2.6. However, in PI AF SDK Guidelines from 2015, also targeting AF SDK 2.6, attribute path searches are listed in the caution section (page 15).

       

      Which recommendation is correct? Which are the most efficient search strategies? Appreciate it if anyone has any experience to share, maybe also with some test results.

        • Re: Efficiency of path searches
          Rick Davin

          Hi Håkon,

           

          The way I interpret the slide show regarding paths is in regards to finding elements by path.  Granted some later slides show performance metrics of several improvements including FindElementAttributes but that method is not limited to pathing as you could just as easily find attributes by category.

           

          The SDK Guidelines PDF specifically mentions finding attributes by path.  While both referenced documents mention finding something by path, they both are talking about different things.

           

          With that said and to answer one of your questions: Both are correct.

           

          Also since PI AF SDK 2.8, the newer AFSearch related classes are considered preferred particularly for finding elements.  See this helpful blog post from Barry Shang.  His post includes some performance metrics.

           

          Regards,

          Rick

           

          P.S. - As you seem to be working with PI AF SDK code, you should give strong consideration to joining the PI Developer's Club Forums.

          1 of 1 people found this helpful
            • Re: Efficiency of path searches
              Hakon.Bjorlykke

              Thanks for the quick answer Rick. I'm at the early stage of making an application where efficiency of reading historical data is a key factor. Appreciate the guidance to Barry Shang's blog post which will come in handy.

               

              PS: I will look into joining the PI Developer's Club Forums :-)

                • Re: Efficiency of path searches
                  Rick Davin

                  Hi Håkon,

                   

                  So PI Developers Club is a free paid-subscription space within PISquare that is dedicated to code-related posts.  I can't imagine a reason why anyone who is a developer would not want to register (again, its free a paid subscription to register but full of useful info).  Several people post code samples on a variety of topics.  As a fellow coder, I think you will be quite happy there.

                   

                  See this FAQ.