MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

call statement - cost of it

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
jctgf
Beginner


Joined: 05 Nov 2006
Posts: 89
Topics: 36

PostPosted: Thu Oct 01, 2009 9:22 am    Post subject: call statement - cost of it Reply with quote

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
View user's profile Send private message Send e-mail
Terry_Heinze
Supermod


Joined: 31 May 2004
Posts: 391
Topics: 4
Location: Richfield, MN, USA

PostPosted: Thu Oct 01, 2009 9:32 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
jctgf
Beginner


Joined: 05 Nov 2006
Posts: 89
Topics: 36

PostPosted: Thu Oct 01, 2009 10:51 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Terry_Heinze
Supermod


Joined: 31 May 2004
Posts: 391
Topics: 4
Location: Richfield, MN, USA

PostPosted: Thu Oct 01, 2009 2:33 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
haatvedt
Beginner


Joined: 14 Nov 2003
Posts: 66
Topics: 0
Location: St Cloud, Minnesota USA

PostPosted: Sun Oct 11, 2009 12:39 am    Post subject: Reply with quote

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
View user's profile Send private message
Terry_Heinze
Supermod


Joined: 31 May 2004
Posts: 391
Topics: 4
Location: Richfield, MN, USA

PostPosted: Sun Oct 11, 2009 12:25 pm    Post subject: Reply with quote

"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
View user's profile Send private message Send e-mail
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Sun Oct 11, 2009 11:18 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group