1 of 1 people found this helpful
If you are on PI AF SDK 2.8 or better, you should use AFEventFrameSearch.FindEventFrames. The older AFEventFrame.FindEventFrames is more sluggish because it must load and sort everything into memory before your foreach would be reached. With AFEventFrameSearch, event frames are streamed to you in smaller paged groups.
If you are on PI AF SDK 2.9.1, or need a great reason to upgrade, there is the lightweight AFEventFrameSearch.FindObjectFields. Much, much faster than the old methods. See this blog in the section Explaining the Performance Boost for an explanation of why its faster.
I know this is 5 months old, but were you able to improve performance? If you were using AF SDK 2.9.x, the the AFEventFrameSearch.FindObjectFields would have been a tremendous performance boost particularly for retrieving values.
The bulk of the slowness would not have on finding and retrieving the event frames. Rather, you are making 3 individual GetValue() calls for each event frame. If you have 10K event frames returned, you are making 30K additional calls to the server to get data values. There would be a way to make bulk calls, but how they would work for you requires knowing more than the simplified loop that you have provided.
For some reason this post bubbled up to my queue today. I wanted to follow up with you to see what you did with it.