Announcement

Collapse
No announcement yet.

call("xxx.efs");

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

  • call("xxx.efs");

    Question: What sort of overhead is involved in using the call("xxx.efs") function to get my values. For example, my code looks like this:

    function main()
    {
    var vValue1 = call("SlowFFF.efs");
    var vValue2 = call("FastFFF.efs");

    return Array(vValue1, vValue2);
    }

    Am I facing any performance issues here?

    Thanks
    Guy
    Standing on the shoulders of giants.

  • #2
    Guy
    In the example you posted it should be virtually the same as running the called EFSs themselves
    Irrespective in general you should have slightly less overhead using callFunction() rather than call().
    For some information on the differences between call() and callFunction() and their usage you may want to see this thread
    Alex

    Comment


    • #3
      Many thanks Alexis, that explains a lot.

      Just to clarify:

      In this example, say the SlowFFF.efs function had a preMain() which looked like this:

      function preMain()
      {
      addEntitlement( "http://share.esignal.com/X/X.txt",
      "Sorry. You are not authorized to use...",
      "http://..." );
      }

      Would the X.txt entitlement file be queried on each and every call (each tick) to the main() function that uses call()?

      Regards,
      Guy
      Standing on the shoulders of giants.

      Comment


      • #4
        Guy
        I beliieve preMain() is called once only when loading (or reloading) the efs and not on every tick.
        Alex

        Comment


        • #5
          In the case of loading an EFS PreMain() is only run once. So using call() it should only be run once on load. I'm not clear on if it is run at all if callFunction() is used, I don't think it would be.

          As for the overhead question...Alex is right as far as system loading is concerned, but as far as added time for execution in your EFS - there is additional overhead in using call() or callFunction() that would not be there had you embedded those functions in the original (calling) EFS.

          Garth
          Garth

          Comment


          • #6
            If callFunction() is used then preMain() does not get called at all.
            Alex

            Comment


            • #7
              Many thanks for the comments everyone.

              From what I can work out it looks like the call() function works something like this.

              // preMain() in this file would reset firstCall to true
              bool firstCall = true;
              function call(fileName, paramList)
              {
              if(firstCall)
              {
              callFunction(fileName, "preMain", paramList);
              firstCall = false;
              }
              callFunction(fileName, "main", paramList);
              }

              So it's just a wrapper for the callFunction().

              I assume that the callFunction() is essentially exposed to allow a script writer to build a library of utility functions that they can store in the same file and don't need to repeat in each of their EFS files. This is what led me to the original question of the efficiency of using the call() function. Is the overhead so high that it's worthwhile maintaining identical functionality seperately in each EFS or is it low enough that you can package the same functionality into a library EFS and use call()/callFunction()?

              Guy
              Standing on the shoulders of giants.

              Comment


              • #8
                This is what led me to the original question of the efficiency of using the call() function. Is the overhead so high that it's worthwhile maintaining identical functionality seperately in each EFS or is it low enough that you can package the same functionality into a library EFS and use call()/callFunction()?
                Well, again it depends on what you call overhead. Are you talking system overhead or latency for you app associated with calling an outside function?

                call() acts just like a second EFS running. It can have a large impact on overall system. It will also have some effect on your studies execution time vs. embedding the same code in your calling study.

                callFunction() has less system overhead, but does add latency vs. embedding it into the calling study.

                You are correct. I requested callFunction() be added so that developers could build up a library of functions that could be coded once and reused...with all the benefits that implies.

                I use callFunction() a fair amount, and don't have any problems. Be aware that there are some differences between using callFunction() and embedding the code, but once you understand this it is easy to work with.

                Garth
                Garth

                Comment

                Working...
                X