MCG pitfalls

Hi there,

Can anyone tell me in a nutshell if there are any negative ramifications to using the Optimized Compiler option (MCG) across the board. We have just used it on two programs and in the one case the CPU utilization was improved by 13%, and in the other by 86%!.

Neither of these used ADABAS, but the improvement is still substantial.

Should we just use it for everything, or like Prefetch, is it something which we should take on a case by case basis?

Regards

John

The only drawback, if you will, is the increased size of the GP, besides that you shouldn’t see any kind of negative impact when using it “for everything”.

Actually there can be some drawbacks IF you aren’t carefull with some of the options. I know there some bugs which have been addressed in v4 (we are still at Nat3.1.6 NOC2.3.7), but the general idea still applies.

It mostly comes down to poor Natural coding practices, but some examples are:

Index range checking - if turned off and range checking is not done in the program then other memory can be accessed that isn’t actually for the array.

Numeric checks - (bug?!?) invalid data can be stored in numeric fields as a result of redefines which include both alpha and numeric fields if certain options used. I.E.
DEFINE DATA
LOCAL
01 #ALPHA (A10)
01 REDEFINE #ALPHA
02 #NUMBER (P5.1)
01 #RESULT (N6.1)
END-DEFINE
*
#RESULT := #NUMBER
END
With certain options this will not cause an OC7, even though #NUMBER really doesn’t contain a valid packed value.

That’s right, these problems have been addressed.

But the way I interpreted the original question was if there’s a potential for performance degradation when turning NOC on globally.

Hi Wolfgang,

Just to clarify, are you saying that with index range checking turned off there is no longer a chance to access memory locations not allocated to the array?

Didn’t mean to disagree with you, just interpreting for a bigger picture :wink:

Going back to Johnc’s original question, I would agree that in general it is better to switch on MCG across the board. You may need a larger bufferpool, but you should always get some performance benefits

However, as Chad said, you need to carefully think about what MCG parameters to use. In my opinion INDX,OVFLW should always be used without exception. (I have spent many happy hours looking at dumps where storage corruption has been caused by index out of range conditions!)

Regarding the question of whether an 0c7 is caused by the assignment of invalid packed data. I recently came across the DIGTCHCK parameter with NOC41. This will add an extra check on assignment of packed/numeric fields which will cause an abend on invalid data (as Natural already does by default).

Regards
Jon

Sorry, missed this question…

No, this can still happen with index checking off.