I wanted to close the loop on this, and frankly, vent a little bit.

I played around and played around with different C++ and LE options -- nothing 
seemed to make a big difference. So finally I wrote a trivial, 3-machine 
instruction, do-nothing ADATA exit in HLASM. It turns out the overhead is not 
in C++ and LE -- it's in the COBOL compiler calling exits! Here are the numbers 
-- CPU seconds, details below -- for various situations:

NOADATA: 1.91 CPU seconds
ADATA to DUMMY: 1.935 CPU seconds
ADATA to DASD: 2.04 CPU seconds
ADATA to DUMMY, 3-instruction exit: 2.82 CPU seconds -- an overhead of over 45 
percent!

Details: REGION=0M, COBOL 6.2, up-to-date on PTFs, typical options, OPT(0), 
52,063 lines, 34,012 statements, z14-M01, TCB+SRB time per IEF033I. All tests 
run on a reasonably quiet LPAR.

Grrrrr!

Charles

On Sat, 30 Dec 2023 16:36:07 -0600, Charles Mills <charl...@mcn.org> wrote:

>I have a working Enterprise COBOL compiler exit written in XLC C++. It 
>functions "correctly" but it is consuming more CPU time than expected, and I 
>have this suspicion that it is going through LE initialization on each entry.
>
>The COBOL doc says of exit modules "The Enterprise COBOL compiler 
>automatically manages a preinitialized Language Environment at compile time, 
>and calls compiler exits within this environment. Therefore, the following 
>rules apply: Compiler exits are run as subprograms instead of main programs. 
>Compiler exits must not include logic for explicitly initializing or 
>terminating Language Environment."
>
>I have not done anything real special in the C++ code. My entry point is *not* 
>a "main" function and is declared extern "OS" void. I am pre-binding and 
>linking pretty much as I have done for other C++ programs. I tell the binder 
>simply INCLUDE, ENTRY and NAME with no reference to CEESTART.
>
>Is there something "special" that I should be doing differently?
>
>Phrasing the question differently, if an LE program loads an LE program by 
>module name and then calls it, how should that called program be compiled and 
>bound so as to avoid repeated LE initialization?

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to