For Programmers: Free Programming Magazines  


Home > Archive > Cobol > September 2007 > Re: COBOL "non-myth" confirmed - Index and subscripts (MF on Windows)









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: COBOL "non-myth" confirmed - Index and subscripts (MF on Windows)
Robert Jones

2007-09-15, 7:55 am

On Sep 15, 7:50 am, Robert <n...@e.mail> wrote:
> On Fri, 14 Sep 2007 22:51:45 -0700, Richard <rip...@Azonic.co.nz> wrote:
>
>
>
> There would probably be one multiply on the subscript because the optimizer would use that
> value on subsequent accesses. (I wrote that before reading your paragraph below sayig the
> same thing.)
>
>
> 1. Because a timing test showed indexes are slower.
> 2. Because multiplication is now as fast as loading an index.
>
>
> Subscript was faster in my test because the subscript was optimized but the index
> apparently was not. It appears the code was reloading the index on every iteration.
>
>
> Most people who use indexes believe it. Why else would they use indexes?


I think many programmers read the programmer's guide for the compiler
and not unnaturally tend to believe its recommendations without the
need to test them unless there are obvious reasons to do so.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com