The functionality for tracing, breakpoints, and single-step that the BEAM emulator provides is not available in native compiled code. There is also a limitation on the fact that native code is not actually unloaded from memory when loading newer versions of the same module. (This can be a problem if you have a long-term system in which you constantly update modules or generate and compile modules.)
In addition, there is a small overhead when switching between the native code and the BEAM emulated code, so you should avoid switching modes in a narrow loop where speed matters. It is preferable to compile all closely related modules with native and, if possible, with the most important standard library modules.
Finally, although the native compiler is fairly well tested, the likelihood of a compiler error in HiPE is slightly higher than the error in the code of the BEAM emulator (although probably not higher than errors in GCC), so you may run the risk of system crashes. These days are pretty rare.
In general, the main place where compilation is not recommended at the moment is stand-alone products (for example, the black box server that you deliver to the client), where stability, remote debugging and low memory usage are your main concern and speed of calculations, as a rule, are not.
RichardC Feb 06 2018-10-06T10 :07
source share