Steve Fink wrote:
I don't really know a whole lot about this area, but I remember I was
surprised the first time I looked at this and discovered it was based
on pointers instead of offsets. I assumed there was some good reason
for it that I didn't know at the time (eg performance), but now I
doubt that. Your way seems much better to me. (It makes debugging
slightly easier too.)
Yep
... Have you tried it on a more RISC-y machine where any performance loss might be more noticeable? I tried the change you suggested on a PPC, and saw no speed difference.
No, I just did this quick test on 2 machines (1 Athlon, 1 Pentium). On RISC machines with probably plenty registers I expect similar i.e. no effects.
But even when there is a slight speed impact - which I doubt - then this speed impact would only harm the interpreted run loops and only, when the whole program is just looping like mops.pasm.
But for such programs, timings like these hold (on Athlon 800):
CGoto: 20
fast_core: 12
Prederef: 17
JIT: 800
C no opt 195
C -O3: 277
So when the whole thing is run loop bound, you have already lost ;-)
Real world programs are not run loop bound, so I don't see any harm in changing the run loops to take an offset.
leo