Chapter 14
Profiling Panini Programs

14.1 Using Panini Profiler

You could also profile a Panini program to compute runtime and memory consumption of various parts of that program. This can be done from command-line using the ’panp’ (for Panini profiler) command available in the Panini distribution.

An example usage of ’panp’ is shown below. The following assumes that you have downloaded and installed the Panini compiler distribution.

[examples] $ ../bin/panc 
[examples] $ ../bin/panp HelloWorld 
[examples] $ ../bin/panc 
[examples] $ ../bin/panp HelloWorld 
profiler: on 
remote: off 
port: 15599 
thread-depth: compact 1 
max-method-count: compact 1 
file: profile.txt 
track.object.alloc: on 
output: text 
debug: off 
output-method-signatures: no 
clock-resolution: ms 
output-summary-only: no 
Accept ClassLoader: sun.misc.Launcher$AppClassLoader 
Java Interactive Profiler: starting 
Hello World! 
Controller -- shuttingdown 
[examples] $ cat profile.txt

The file profile.txt contains the runtime profile generated by the profiler.

14.2 Configuring Panini Profiler

You could change the settings of Panini profiler by modifying the file ’PANC_
HOME/lib/’. Here, ’PANC_HOME’ is the directory in which your Panini distribution is installed.