Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Confused About Rprof with R

Tags:

r

I'm confused as to how to get Rprof to work with R.

I followed the sample in the documentation and had something like

Rprof(filename="testProfile.out")
test()
Rprof(NULL)
summaryRprof("testProfile.out")

However, inside testProfile.out, I had one line : sample.interval=20000

This confuses me and when I run summaryRProf, I get no events were recorded

Any suggestions would be appreciated.

like image 774
user1431282 Avatar asked Dec 11 '25 20:12

user1431282


1 Answers

The issue was that my test was completing too quickly and Rprof was not logging at fast enough intervals. To fix, this you can either set interval = 0.0002 or some number smaller than the default value (0.02). I was also able to fix this by running my test for multiple iterations.

like image 54
user1431282 Avatar answered Dec 14 '25 12:12

user1431282



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!