[MLton] fields at the front of GC_state

Daniel C. Wang danwang@CS.Princeton.EDU
Tue, 04 Jul 2006 18:30:10 -0700


Why not just introduce an extra struct that groups the high-frequency 
fields. This should be flattened out by the C compiler. You can keep the 
fields within the new struct alphabetized. More importantly, you can 
document that these set of frequently used fields should be treated 
specially.

Stephen Weeks wrote:
> One thing that might be hurting performance with the new runtime, both
> in speed and code size, is that the frequently used fields have been
> moved from the front of GC_state elsewhere.  The old runtime had the
> following at the front of GC_state.
>
>         /* These fields are at the front because they are the most commonly
>          * referenced, and having them at smaller offsets may decrease code size.
>          */
>         pointer frontier;       /* base <= frontier < limit */
>         pointer limit;          /* end of from space */
>         pointer stackTop;
>         pointer stackLimit;     /* stackBottom + stackSize - maxFrameSize */
>         uint exnStack;
>
> I see that all of these fields still exist in the "top level" of
> GC_state, and so could easily be moved back to the front.  As much as
> I like alphabetization, I can stomach the loss of it here if it buys
> performance.
>
> _______________________________________________
> MLton mailing list
> MLton@mlton.org
> http://mlton.org/mailman/listinfo/mlton
>