The normal way to native-compile an Erlang module using HiPE is to include the atom native in the Erlang compiler options, as in:
1> c(my_module, [native]).
Options to the HiPE compiler are then passed as follows:
1> c(my_module, [native,{hipe,Options}]).
For on-line help in the Erlang shell, call
The HiPE compiler is in general compliant with the normal BEAM compiler, with respect to semantic behavior. There are however features in the BEAM compiler and the runtime system that have limited or no support for HiPE compiled modules.
Stack traces returned from
Source code line numbers in stack traces are also not supported by HiPE compiled functions.
Erlang call trace is not supported by HiPE. Calling
Modules compiled with HiPE can not call
Modules compiled with HiPE can not use
The HiPE compiler does in general produce faster code than the BEAM compiler. There are however some situation when HiPE compiled code will perform worse than BEAM code.
Every time a process changes from executing code in a HiPE compiled module to a BEAM compiled module (or vice versa), it will do a mode switch. This involves a certain amount of CPU overhead which can have a negative net impact if the process is switching back and forth without getting enough done in each mode.