ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Static binding vs dynamic binding

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

  • Static binding vs dynamic binding

    What if no.of Calls in a program increase?
    Does performance cost more? if so,then which one is better approach static binding or dynamic binding?

    Thanks
    Dileep

  • #2
    Re: Static binding vs dynamic binding

    Are you asking if a program does more stuff does it use more cpu?

    it is faster to call a number direct versus calling directory assistance then getting connected. But the ibm i is so dam fast that you wont notice a difference, unless you have a ton of calls. And I mean a ton of calls to the same program.
    Hunting down the future ms. Ex DeadManWalks. *certain restrictions apply

    Comment


    • #3
      Re: Static binding vs dynamic binding

      like TONS of TONS ... try it... write a program that writes a timestamp out to a file, then does 50,000 calls to a staticly bound procedure and then writes to the file again with the current timestamp. Then write a second program that does the same thing except instead of calling a staticly bound procedure call a dynamicly bound procedure. Then you will know what the difference is...

      The pseudo code would be something like this
      Code:
        my_ts = %timestamp();
        write myfile;
      
        for x = 1 to 50000 by 1;
          static_bound_proc();
        endfor;
      
        my_ts = %timestamp();
        write myfile;

      Comment


      • #4
        Re: Static binding vs dynamic binding

        Its really fast either way. Even if you write your own double dispatch procedure resolution it's -still- pretty fast.

        Comment


        • #5
          Re: Static binding vs dynamic binding

          The amount of times it takes to call iterations of a program is mostly influenced by the persistence of the called program.

          A) If an OPM program is returned with INLR off, or if an ILE program is activated in a named activation group, then it will not take long to call iterations of the program.

          B) If an OPM program is returned with LR on, or an ILE program is activated in a *NEW activation group, then each iteration will take quite a bit of time. (Relatively speaking, it's still really fast.)

          For B, the heavy increase in time is almost exclusively due to security checks on the called program, and security checking the file and other resources in that program, as well as closing the ODP's and flushing the program buffer upon each and every call of the program in the loop.
          Michael Catalani
          IS Director, eCommerce & Web Development
          Acceptance Insurance Corporation
          www.AcceptanceInsurance.com
          www.ProvatoSys.com

          Comment

          Working...
          X