Using the Working Set Tuner

Using the Working Set Tuner is similar to using CAP, from which it is derived. You must first recompile your application with the -Gh and -Zd switches. Then, you link it using the WST.LIB and the linker options debugtype:coff and debug:full. This prepares your executable's C routines to be prepped for the working set tuner.

To run the Working Set Tuner, you first create a WST directory in the root of your C drive. Into C:\WST you place a WST.INI file. This file contains three required section headers:

In our case WST.INI looked like this:

|


[EXES]
sol.exe
[PATCH IMPORTS]
[TIME INTERVAL]

Before you take a measurement you must place the WST.DLL measurement library on your path.

You use the wstdump utility to specify which portion of your application's operation is tuned. As with the other measurement control utilities, you can clear and dump the counters at any time. When the application ends, these data files are dumped automatically. Dumping the data always places it into the C:\WST directory in files with names of the form modulename.WSP and modulename.TMI. If you dump data multiple times, the file extensions from each dump will be modified to .W?? and .T??, where ?? is a hexadecimal number between 0x01 and 0xFF inclusive.

You can concatenate the data from multiple scenarios using the wtscat utility. It produces composite .WSP and .TMI files after renaming the original ones to .WXX and .TXX. The weight of the files in the concatenated result depends on the length of each experiment, or more accurately—because you might have varied the time interval—on the number of snapshots in each. The bits for each function from the multiple files are concatenated, not or'd together.

When you are done with the measurement, you produce the packing list with the wstune utility:

wstune /o modulename.wsp

The principal result of wstune is a modulename.PRF file, which you use when you recompile your application. You will link with the order:modulename.prf directive. The wstune utility also produces a .DT file showing the tuned order of functions with the bitstrings, and a .DN file showing the unordered functions and, at the bottom, a count of how many pages were touched in the unordered case.

To implement the working set improvements, recompile your application using the -Gy compiler option. This option assures the linker knows the location of the start and end of each function. Then you can link the application using the linker option by typing:

-order@modulename.prf

That's all there is to it. Next to Performance Monitor, the Working Set Tuner is our favorite tool.