This change set provides a 18 - 28% improvement in the GC logic using an test image that has 1.1 million objects in it on the PowerPC. I won't comment on if this makes any difference on intel, however someone might try it and see what happens.
In early December I took a look at the garbage collector and realized for the mark logic, at least on the PowerPC, we were moving three key variables in and out of memory multiple times per object, versus keeping everything in a register or two. Also we managed to make some procedure calls for each object we looked at, which is time consuming.
In discussing a possible fix with Tim, we realized that in some cases because of inlining, why some global variables actually become local variables because different SLANG methods are folded together.
This change set add logic to review variable usage and if possible fold variables that only appear in one inlined method into a declaration within the one method and dropped them from the globals. Right now I only deal with interp.c, and I've not really studied say variables across N methods where N is > 2 but say < 6 to understand what could be done with a bit more tweaking.
Interesting enough these variables are: field, parentField, child in the Mark Logic cntx, val in the interpret routine.
A bit of slang changing was also done to:
1) Provide an array headerTypeBytes, a lookup array for the header byte length calculation versus doing a couple of IF statements. 2) A few restructuring hints to ensure procedure calls actually become inlined, where in the past they violated an inlining rule. 3) Some really large routines in the compacting logic were broken into multiple routines, because the logic is really in multiple steps and this helps the compiler (ah stupid compilers) deal with register allocation better. Also it helps one think about why we have multiple steps.
I think a bit more work could be done in this area, but I'll look for feedback first.
Also I've moved the logic from voidIsNotInt that dealt with ensuring bogus unused variables are deleted into this change set.
Now for the Globals as a structure logic, I've attached an addendum change set (GCMakeItFasterGStruct-JMM.6.cs.gz) to provide the following feature: Declare foo as a pointer to the foo structure as a local, this makes for better powerpc code which improves overall performance by a few percentage points. You also need this changeset because of some structure changes if you've filed in the globals as a structure changes sets, and want the faster GC speed.
-- ======================================================================== === John M. McIntosh johnmci@smalltalkconsulting.com 1-800-477-2659 Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com ======================================================================== ===