[squeak-dev] Rearranging variables in interpreter struct (lil speedup)

Igor Stasenko siguctua at gmail.com
Fri Feb 29 04:34:40 UTC 2008


I just wondering, what if i place variables in interpreter struct in
specific order,
not in order, which code generator produces.

Since speed impact expected to be very small (if any), i used
following code to measure difference.

[ 5 timesRepeat: [ 1 tinyBenchmarks] ] timeToRun

This is HydraVM without attempts to arrange interpreters ivars:

 28921
 28863
 28863

This build shows a small slowdown (i placed all big-sized arrays at
tail, and #stackTop #successFlag at head)

 28938
 28940

With this build i placed methodCache ivar to come first.

 28279
 28264

so, difference is small but noticeable. Placing methodCache first
gives roughly 1-2% speedup.

I don't really sure if this worth experimenting at all. And i'm
lacking of knowledge of different CPU/compiler details to predict that
these changes will take effect on different CPUs (mine is AMD Athlon
series).

If you having any ideas, concerning given changes, or any other
optimizations which can probably improve speed, please feel free to
uncover details/guidelines.

-- 
Best regards,
Igor Stasenko AKA sig.



More information about the Squeak-dev mailing list