Using gst-profile to profile Iliad
I am using Iliad for the configuration of my GSM Basestation (another blog entry will follow) and the response time has not been that great when showing a lightbox (e.g. the one from todolist example). I wanted to see where Iliad is spending the time and potentially improve the performance of either GNU Smalltalk or Iliad.
The GNU Smalltalk interpreter is keeping a counter on the executed bytecodes and is exposing this profiling information to the Profiler package. This package will create a file that can be opened with the excellent kcachegrind viewer. This aligns nicely with the Unix philosophy of having one tool per task.
The gst-profile application will load the default image, run a script and then write the profile information to a file. This means the first thing I need to do is to load the Iliad package and create a snapshot of the image. Then I can use gst-profile to evaluate a function, render webpages and exit gst. This will create a file called gst-profile.PID (where PID is the value of the GST process) and this file can be opened using kcachegrind.
# Load iliad and save the default image $ gst st> PackageLoader fileInPackage: 'Iliad'. st> ObjectMemory snapshot
# Start Iliad and run until a line feed. $ gst-profile -e 'Iliad.SwazooIliad startOn: 8082. stdin next' Press enter/return to exit $ ls gst-profile.* $ kcachegrind gst-profile.*