I have problems with this assertion. Reentrant code tends to be larger than non-reentrant code and to run slower in that it generally has to increase the instruction path length due to the need to acquire and release dynamic storage for work areas and to copy model data into that dynamic storage.
It is true that you can share copies of a reentrant module across address spaces, which can eliminate the need for repeated LOAD requests, and can save memory. However, an evaluation of how and where the module is to be used is needed in order to determine whether writing the module to be reentrant is justifiable. A flat assertion of better performance is not supportable. John P Baker Software Engineer -----Original Message----- From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On Behalf Of Charles Mills Sent: Saturday, October 21, 2006 11:24 To: [email protected] Subject: Re: Is the teaching of non-reentrant HLASM coding practices ever defensible? > reentrant code tends to run faster than non-reentrant code Could you elaborate on that? I understand that there is a savings if reentrant code can be reused without reloading (such as if it is resident in the LPA) but why would reentrant code be inherently faster than non-reentrant? There is certainly an additional overhead for GETMAIN, storage initialization, often an extra level of indirection, etc. Reentrant design often burns one more register, which may in turn lead to additional register save and restore operations. Reentrant code is typically more scattered in its storage references, which increases paging overhead (at least in theory). It's an academic question, I admit. 99% of all assembler code is so fast it does not matter, and the 1% that matters can always be optimized despite any considerations for reentrance. I'm just curious about your assertion. Charles ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html

