Announcement

Collapse
No announcement yet.

Ref: efsInternal -which of these methods is best?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Hi Wayne,

    Here is the followup to those items below.


    Originally posted by waynecd
    Hi Steve,

    Just wondered if you still have comments on the items below?
    Either way, thanks for your help.

    Wayne

    When efs2 was introduced, the Performance monitor did not initially work as expected. It had a hard time discerning resource usage between the different timeframes, and when multiple efs's were run, the majority of the resources were attributed to one efs. While I believe this has been fixed , I always verify things by running the different efs's by themselves to verify the performance results are being accurately reported.

    To this end, I encourage you to run several of the efs files by themselves over the same timeframe and same number of days. When complete, I'd like to see if you saw any differences. Also make sure you do not play back the efs files too quick, maxing out your processor will also have an adverse impact on the Performance monitor results.


    This is based on my rudimentary understanding of the efs2 Series object that eSignal created to handle multiple timeframes. Details associated with the object model are proprietary and unknown to me. It is certainly not necessary to use the functionality, but I believe it may be of some assistance. I suggest that you digest this information along with some very good tutorial like threads on efs2 in the links in my signature block below. FWIW, you'll see in these links that you should only create series objects using efsInternal() and efsExternal() for inputs to other series objects or for establishing series from different timeframes. They should not be used for functionality that can be obtained by using regular functions (file access, etc).

    When you create a Series object, the object is registered with the efs engine and is executed by the efs engine at the prescribed frequency/timeframe. This 'outer' Series object has internal methods (functions) and properties that represent the details associated with the series. An example of a method is getValue() and an example of a property is (are) private object(s) which reference the output values of the Series. Both objects (outer Series and private object(s)) seem to have a getValue() method which will return output values based on the index provided in the getValue() method. Based on my understanding, the getSeries() function seems to return a reference to the internal object that represents the output values. Objects are passed by reference btw, which is critical to this and my earlier explanation.

    What I missed in my earlier explanation was that when you create a Series object that has just one output object, you still have to use the getSeries() function to get the reference to the internal object that represents the output values.

    Picking up where I left off previously, once you have a global variable that references the internal series (representing the Series object output), you no longer have to execute the getSeries() function every tick to see changes in that object. This is because the internal object has been passed by reference and updates automatically.

    I hope this makes sense and you find it helpful.

    Comment


    • #17
      Hi Steve,

      You really put some thought into this, thank you.

      I will use your posted links to study over the next few weeks. The information is very helpful. I see that I will need to change several of my efs scripts due to misuse of efsInternal().

      I'll run the performance monitor per your instructions this weekend and let you know. I did run my first test at max speed so I will check CPU usage for the best speed.

      I've known that my scrips were not very efficient but didn't have a clue as to how to improve them.

      Thank you for taking the time.

      Wayne
      Last edited by waynecd; 12-10-2008, 06:32 AM.

      Comment


      • #18
        Hi Steve,

        The second run of the Performance Monitor ended with the same result, script D was the most efficient. Script E was the worst, it calls an efsIntenal function, in effect creating a second series object (as I understand it). In the last post with Performance Monitor data I only included the results for main for script E. Here I include all data.

        Wayne

        Here are the Performace Monitor results.

        PHP Code:

        Max CPU Usage did not exceed 50
        %.  Each script  was run by itself.                

        Script  Function                Total Calls    Total Time (ms)    Avg Time (ms)

        A         main                    841184         17075              0.0203
                  Total                   841184         17075              0.0203

        B         main                    841184         3813               0.004533
                  Total                   841184         3813               0.004533

        C         main                    841184         3723               0.00426
                  Total                   841184         3723               0.00426

        D         main                    841184         2724               0.003238
                  Total                   841184         2724               0.003238

        E         StochFunction           841184         107558             0.1279
                  Total                   1682369        113637             0.06755
                  main                    841185         6079               0.007227 
        Last edited by waynecd; 12-14-2008, 09:52 AM.

        Comment

        Working...
        X