About the Working Set Tuner

WST reduces the number of code pages that have to be in RAM for your program to execute. It reduces them by helping the linker put your executable together in a way that minimizes the number of pages you use at a time. With any application, there are probably many optimal assignments of functions to pages. WST will produce results at least as good as a programmer could achieve by hand in a more reasonable amount of time.

Typically, your executable image is put together in the order in which address references are resolved. This method has nothing to do with the need for particular routines to reside together in memory, because lots of functions get called only under error conditions or other unusual situations. However, the references to these routines are near references to routines that are used all the time.

WST provides a packing list to the linker so the linker can place functions into the executable image in the order that most reduces paging. The linker place the most frequently used functions together in the .EXE image. This continues in order of usage until the linker reaches the functions that are never referenced. It places these at the end of the .EXE in "don't care" order.

Consider the following example.

status = DoSomethingFirst( );
while (status == WONDERFUL) 
{
    status = ProcessNormally( );
} else 
{
    PressThePanicButton( );
}
 

If this is the first time the linker has seen these symbols, it would put DoSomethingFirst in the .EXE, followed by ProcessNormally, and then it would put in PressThePanicButton. But DoSomethingFirst is only used during initialization, and PressThePanicButton is only called under extreme circumstances. If the linker placed ProcessNormally in the .EXE with other routines that are used frequently, DoSomethingFirst with routines that are used only to initialize the application, and PressThePanicButton somewhere else, it would reduce paging. When the image is ordered that way, pages loaded when ProcessNormally is first executed would likely contain only routines that are used frequently, the page containing DoSomethingFirst would likely be discarded after initialization, and the page containing PressThePanicButton would be loaded only on error.

Typically, WST provides between 25% and 50% savings on code space used. You can expect a 30% reduction in your code space for the test scenario that you measure. But the operational results of your efforts depend almost entirely on how well you designed your test scenario. Using WST without proper preparation does not help much.