This is a graphical Profiling-Tool for use in the Squeak-Smalltalk Environment.
Setup the project using Metacello. You may specify a branch other than master
.
Metacello new
baseline: 'InteractiveProfilingTool';
repository: 'github://hpi-swa-teaching/InteractiveProfilingTool:master/packages';
load.
Open the Profiler via the World Menu under Apps -> Interactive Profiler
Toggle profiling
A report window as shown above opens
Profit :money_with_wings:
A relevance threshold is employed to hide method calls with an insignificant runtime. The value is hardcoded in such a way that method calls with less than 1% relative runtime are excluded from the result tree. If you want to change the threshhold, you can do so by changing the return value of IPTMessageTallyWrapper >> callRelevancePercentage
.
Moreover, the spy-on functionality that allows profiling of individual methods is not yet fully implemented. If you know what you are doing, you can make a hacky solution like:
tally := MessageTally new.
tally spyEvery: (MessageTally defaultPollPeriod) on: ["put your code here"].
IPTReport openReportFor: tally
Using the GC Stats
you can view garbage collection stats for the profiled period:
Since there is no comprehensive, central documentation for the Squeak Garbage Collector, this may be a useful primer for you:
The Squeak garbage collector follows the Mark-Sweep-Compact GC pattern. Memory is divided into two regions, the young and the old space. The young space contains short-lived objects, the old space contains long-lived objects (tenures). There are two different garbage collection methods: Full GC and Incremental GC. An incremental GC collects garbage from the young space only, while a full GC runs in both regions.
If you are looking for more information on garbage collection in Squeak, this wiki entry on garbage collection in Squeak may be a good starting point.
If you want to work on this (or have to in a future SWT lesson :wink:) and have any questions, feel free to open Issues and/or @ us here on GitHub.