| JamaicaVM 3.2 — User Documentation: The Virtual Machine for Realtime and Embedded Systems | ||
|---|---|---|
| Prev | Chapter 8. Profiling using the Builder | Next |
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:
Compilation is limited to the most time critical methods, keeping non-critical methods in smaller interpreted byte-code format.
Method inlining prefers inlining of calls that have shown to be executed most frequently during the profiling run.
Profiling information also collects information on the use of reflection, so an application that cannot use smart linking due to reflection can profit from smart linking even without manually listing all classes referenced via reflection.
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.