| 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.
|