Search code examples
rbuildcompilationdefault

What is the cost of enabling memory profiling?


R's default configuration options disable memory profiling, shared-library libR, static-library libR.a, GNU gettext, valgrind headers, and link-time optimisation.

Some of these (like valgrind) must just be because not everyone will use it. Others might be answered elsewhere on SO (like Is there any reason why not to use link time optimization? might answer --enable-lto[=no]).

But what is the possible disadvantage or cost of enabling memory profiling in R?


Solution

  • Oops, apparently the answer can be found from https://stat.ethz.ch/R-manual/R-devel/library/utils/html/Rprofmem.html:

    The memory profiler slows down R even when not in use, and so is a compile-time option.