Re: COBOL myth busted, index versus subscript (MF on HP)
- From: Robert <no@xxxxxx>
- Date: Wed, 17 Oct 2007 18:55:34 -0500
On Wed, 17 Oct 2007 12:24:09 -0700, Vivian <vsaegesser@xxxxxxxxxxx> wrote:
Very interesting test. For comparison purposes, I ran Robert's code
on our ancient mainframe (it's a very old slow box). Since I too was
curious about an array without an index defined, I created another
iteration of the test, to do the same 2 tests with an non-indexed
array. Here's my results:
NULL TEST 77
INDEX 93
SUBSCRIPT 150
SUBSCRIPT COMP-5 184
INDEX 1 52
SUBSCRIPT 1 118
SUBSCRIPT 1 COMP-5 154
NON-INDX 1 108
NON-INDEXED COMP-5 149
So it would appear on my box that an aligned index is fastest. But
interestingly, simply defining an index slows you down if you intend
to use a subscript. At least that's what happens on an MP3000.
So, Question, what is exit perform cycle? It gave me a compiler error
so I commented it out. Would that effect the results?
When I first ran the test, the null loop was empty. Micro Focus' optimizer was smart
enough to optimize it down to zero time. As a result, I had no measurement of loop
overhead to subtract. Exit perform cycle was added to make it go around the null loop
repeat-factor times. Since it was in the null loop's time, I had to add it to all the
other loops.
In your case, exit perform cycle was not necessary, so deleting it did not affect the
results.
I don't understand how defining an unused index could affect the speed of a subscripted
access. Can you compare generated code to see what the extra instruction does? What is
comp-5 and why is it slower?
.
- Follow-Ups:
- References:
- Prev by Date: Re: checking if NUMERIC
- Next by Date: Re: checking if NUMERIC
- Previous by thread: Re: COBOL myth busted, index versus subscript (MF on HP)
- Next by thread: Re: COBOL myth busted, index versus subscript (MF on HP)
- Index(es):
Relevant Pages
|