View previous topic :: View next topic |
Author |
Message |
jctgf Beginner
Joined: 05 Nov 2006 Posts: 89 Topics: 36
|
Posted: Thu Oct 01, 2009 9:22 am Post subject: call statement - cost of it |
|
|
I'm aware the dynamic call has a worse performance than the static one.
During my tests I couldn't see any difference though.
I wonder if there's a real difference and how big it is.
My batch program will call a subprogram millions of times.
Thanks. |
|
Back to top |
|
 |
Terry_Heinze Supermod
Joined: 31 May 2004 Posts: 391 Topics: 4 Location: Richfield, MN, USA
|
Posted: Thu Oct 01, 2009 9:32 am Post subject: |
|
|
The advantages of dynamic calls usually outweigh the disadvantages, especially if the called program changes frequently. With CPU speeds being what they are nowadays, I wouldn't expect a lot of difference as far as performance is concerned. I'm not certain, but I suspect that a called program will not have to be fetched from the load library for each call but will remain in memory for subsequent calls. Monitoring your calling program with STROBE or some other tool might help determine the better choice. Test it both ways and let us know. _________________ ....Terry |
|
Back to top |
|
 |
jctgf Beginner
Joined: 05 Nov 2006 Posts: 89 Topics: 36
|
Posted: Thu Oct 01, 2009 10:51 am Post subject: |
|
|
Terry_Heinze wrote: | The advantages of dynamic calls usually outweigh the disadvantages, especially if the called program changes frequently. With CPU speeds being what they are nowadays, I wouldn't expect a lot of difference as far as performance is concerned. I'm not certain, but I suspect that a called program will not have to be fetched from the load library for each call but will remain in memory for subsequent calls. Monitoring your calling program with STROBE or some other tool might help determine the better choice. Test it both ways and let us know. |
Thanks a lot.
Actually I've tested 2 versions - one with static and another with dynamic call - with Strobe and almost couldn't see a difference.
Actually, the version with dynamic call seemed to run a little faster.
I repeated the tests many times.
Both jobs ran at the same time and under the very same conditions.
I think you are right about the subprogram remaining in memory after the 1st call.
Thanks again. |
|
Back to top |
|
 |
Terry_Heinze Supermod
Joined: 31 May 2004 Posts: 391 Topics: 4 Location: Richfield, MN, USA
|
Posted: Thu Oct 01, 2009 2:33 pm Post subject: |
|
|
One of the most severe disadvantages of static calls is that all calling programs have to be recompiled every time the called program changes. _________________ ....Terry |
|
Back to top |
|
 |
haatvedt Beginner
Joined: 14 Nov 2003 Posts: 66 Topics: 0 Location: St Cloud, Minnesota USA
|
Posted: Sun Oct 11, 2009 12:39 am Post subject: |
|
|
not quite correct Terry, the load modules containing the statically called program would have to be RELINKED, replacing the called program with the new version of said program.
=====> this requires that the linkage section of the called program doesn't change. If the information being passed via the linkage area changes then both programs have to be compiled.
P.S. ---> there are also times when there are significant performance advantages with statically linked modules. Specifically when a DB2 Stored Procedure calls another program. (in this case the called program is reloaded into memory every time even when the Stored Procedure is marked as "STAY RESIDENT").
Its been a while since we chatted Terry, send me an email sometime. _________________ Chuck Haatvedt
email --> clastnameatcharterdotnet
(replace lastname, at, dot with appropriate
characters) |
|
Back to top |
|
 |
Terry_Heinze Supermod
Joined: 31 May 2004 Posts: 391 Topics: 4 Location: Richfield, MN, USA
|
Posted: Sun Oct 11, 2009 12:25 pm Post subject: |
|
|
"not quite correct Terry, the load modules containing the statically called program would have to be RELINKED, replacing the called program with the new version of said program."
True, but many developers find it easier to compile and link instead link only since ISPF panels are usually not provided for relinking only and most shops prefer (insist) on using the panels already set up. Also, a recompile might take advantage of more optimized code in case the compiler has changed since last time around, right? _________________ ....Terry |
|
Back to top |
|
 |
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Sun Oct 11, 2009 11:18 pm Post subject: |
|
|
Most sites should use a source control system that does the compiles. Most of those (commercial ones at least) keep track of both source and link dependencies and recompile and relink only what is necessary. If the source for the caller does not change (including copybooks), it won't be recompiled. _________________ New members are encouraged to read the How To Ask Questions The Smart Way FAQ at http://www.catb.org/~esr/faqs/smart-questions.html. |
|
Back to top |
|
 |
|
|