Using the profiling output as input for the compiler

Having collected the profiling data, one can now create a compiled version of the application using the profile information. This compiled version benefits from profiling information in several ways:

The builder option -useProfile is used to select the generated profiling data:

  > jamaica -useProfile HelloWorld.prof HelloWorld
      
Reading configuration from '/usr/local/jamaica/etc/jamaica.conf'...
Jamaica Builder Tool 3.0 Release 1 
Generating code for target 'linux-gnu-i686', optimisation 'none'
 + PKG__Va4f2ef82b5a47927__.c
 + PKG_gnu_java_nio_charset_Ve06c790aa1db1e02__.c
 + PKG_java_io_Ve06c790aa1db1e02__.c
 + PKG_java_lang_Ve06c790aa1db1e02__.c
 + PKG_java_nio_Ve06c790aa1db1e02__.c
 + PKG_java_nio_charset_Ve06c790aa1db1e02__.c
 + PKG_java_util_Ve06c790aa1db1e02__.c
 + HelloWorld__.c
 + HelloWorld__.h
Class file compaction gain: 66.29946% (7189668 ==> 2422957)
 + HelloWorld__nc.o
 * C compiling 'HelloWorld__.c'
 * C compiling 'PKG__Va4f2ef82b5a47927__.c'
 * C compiling 'PKG_gnu_java_nio_charset_Ve06c790aa1db1e02__.c'
 * C compiling 'PKG_java_io_Ve06c790aa1db1e02__.c'
 * C compiling 'PKG_java_lang_Ve06c790aa1db1e02__.c'
 * C compiling 'PKG_java_nio_Ve06c790aa1db1e02__.c'
 * C compiling 'PKG_java_nio_charset_Ve06c790aa1db1e02__.c'
 * C compiling 'PKG_java_util_Ve06c790aa1db1e02__.c'
 * linking
 * stripping
    
  

Due to the profile-guided optimizations performed by the compiler, the runtime performance of the application built using a profile as shown usually exceeds the performance of a fully compiled application. Furthermore, the memory footprint is significantly smaller and the modify-compile-run cycle time is usually significantly shorter as well since only a small fraction of the application needs to be compiled. It is not necessary to re-generate profile data after every modification.