Profiler Package
Svengali Profiler Package
Contact David Jones

The Profiler package is a Dolphin package containing one of the Svengali tools. It provides a flexible environment for applying a variety of profilers to executing code and then viewing and analysing the results.

Installation

You must first ensure that the base Svengali installation has been successfully completed.

To load the profiler into Dolphin open the Profiler.pac package from within the Package Browser.

Running

The profiler has two separate phases; profiling and visualisation.

In the New Profile dialog you enter some Smalltalk code which is going to be profiled while it is executed. You also specify which of the available profilers are to be used to record different aspects of the execution.

Your code is then executed in its own process, with any chosen profilers recording its behaviour.

Once profiling is complete a Director will open from where you can access all the collected data. A range of browsers are available to visualise the data using a variety of filters, combinations and graphical techniques.

Strategies for Use

Successful use of the Profiler package is unfortunately a bit involved at the moment. It is important to be aware of what each profiler records, and how profilers can interact with each other.

When you are first investigating some code, it is worth using all the profilers on the code. You can then browse the results from the Activating profilers and see if anything stands out. For example creating 10,000 Rectangles when you would have imagined background levels. If you wish to investigate the results of the Sampling profilers, you should re-profile the same code with only a choice of the Sampling profilers. You should have compare the differences in the Sampling profilers results from the first and second runs to see how the Activating profilers have biased the results, for example the percentage use of the new selector in the Message Statistics view will be less on the second run.

If you are trying to understand the behaviour of the code you should be able to use the tools to accomplish some drilling down through the data, and building up a picture of the major phases of the computation and how elements fit together. You may like to investigate the Execution Tracer Package for observing the low level message activations. Once this and the Profiler package join in a future release a number of interesting visualisations can be applied to improve on the rather feeble range presently available.

For space optimisations use the New Statistics to highlight unexpected levels of instance creation. This can also show you who requested the object creation. This is only a single level, so it is not very obvious how different sub-sections of your code make use of instantiations. You can use compression feature of the Profile Browser to indicate relative levels of instance creation during the codes execution.

Instance creation is only one half of what is important, and that is the life time of an instance. To deal in these terms we have to broach the unfortunate question of instance death. Presently this can not be detected, the poor devils rot for ever in the corner of a room, but in some fashion this should thankfully be handled in the future.

For time optimisations a number of tools are available, including some supplied with Dolphin. One of interest is the Message Tally Browser which allows you to investigate the message calling tree.