An interesting tidbit for the record

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
tty
Reply | Threaded
Open this post in threaded view
|

An interesting tidbit for the record

tty
in CogBytecodeDescriptor a portion of the class comment reads: " The order of my instance variables is chosen for compact struct packing."

In user-space I have never even considered the order of my instance variables. From that comment, it seems it can matter.


Something to file away in the back of the brain....

tty.


_______________________________________________
VM-beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners
Reply | Threaded
Open this post in threaded view
|

Re: An interesting tidbit for the record

Bert Freudenberg
On 14.01.2014, at 00:50, gettimothy <[hidden email]> wrote:

> in CogBytecodeDescriptor a portion of the class comment reads: " The order of my instance variables is chosen for compact struct packing."
>
> In user-space I have never even considered the order of my instance variables. From that comment, it seems it can matter.

Well, in that context it is only relevant for Slang code, after it has been translated to C.

In regular code, the first 8/16 inst vars are faster to write/read than the higher-numbered ones. Similarly for temps and literals.

- Bert -



_______________________________________________
VM-beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners

smime.p7s (5K) Download Attachment