Does anyone have any advice about profiling C/C++ code in a package under R? Does R need to be built specially for this to work? The FAQ has some entries about profiling but they cover R level profiling; I'm try to get at the C++ code I've written that is called from R. Primary target is Mac OS X. Thanks. Ross Boylan
The last time I tried I didn't have much luck. The gprof manual I could find seems to indicate that it can not profile code that are dynamically loaded. (I was trying on Linux.) The R source seems to hint otherwise. I'd very much appreciate pointers as well. Andy From: Ross Boylan> > Does anyone have any advice about profiling C/C++ code in a package > under R? Does R need to be built specially for this to work? > > The FAQ has some entries about profiling but they cover R level > profiling; I'm try to get at the C++ code I've written that is called > from R. > > Primary target is Mac OS X. > > Thanks. > > Ross Boylan > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > >
On Mon, 20 Feb 2006, Ross Boylan wrote:> Does anyone have any advice about profiling C/C++ code in a package > under R? Does R need to be built specially for this to work? > > The FAQ has some entries about profiling but they cover R level > profiling; I'm try to get at the C++ code I've written that is called > from R. > > Primary target is Mac OS X.Under OS X I use 'sample', which doesn't require any recompiling (or Sampler.app, which is a GUI version) -thomas> > Thanks. > > Ross Boylan > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >Thomas Lumley Assoc. Professor, Biostatistics tlumley at u.washington.edu University of Washington, Seattle
On Feb 20, 2006, at 7:18 PM, Ross Boylan wrote:> Does anyone have any advice about profiling C/C++ code in a package > under R? Does R need to be built specially for this to work? > > The FAQ has some entries about profiling but they cover R level > profiling; I'm try to get at the C++ code I've written that is > called from R. > > Primary target is Mac OS X. >If you have an OS X box to work on, then you have a handful of really excellent tools. Have a look at Shark from the CHUD tools (in / Developer/Applications/Performance Tools) Although it's sampling- based (.i.e. no need to gprof - just run sample running R), it is remarkably accurate and has ton of features for what they call 'data mining' of the profile data - including drill-down to source code and even assembly level. You can read a bit at http://developer.apple.com/tools/sharkoptimize.html It proves to be really useful and very flexible. Cheers, Simon