On 02/12/2014, 4:43 PM, Charles Novaes de Santana wrote: > Dear all, > > I am running a c++ library (a .so file) from a R code. I am using the > function dyn.load("lib.so") to load the library. Do you know a way to > profile my C library from R? Or should I compile my C library as an > executable and profile it using the typical C-profilers? > > Thanks in advance for any help!
If you want line-level profiling of your C++ code, you'll certainly need to use something that's not built in to R. You can probably do it without recompiling your C++ code, just by profiling the R process. But the details certainly depend on the profiler you choose to use. If you just want to know how much time is being spent in each C++ function called from R, Rprof() should be able to tell you. (It might give misleading information if your C++ code takes too long to execute, and some timer ticks get lost; I'm not sure if the underlying code takes account of that.) Duncan Murdoch ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.