Is my using gperftools to profile a R script with RCpp correct?

后端 未结 1 412
萌比男神i
萌比男神i 2021-01-24 22:08

I am trying to profile a R script with the last (third) approach in http://pj.freefaculty.org/blog/?p=140. I wonder if what I do (described in the following) is correct?

1条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-24 23:09

    Instead of

    google-pprof --text /usr/bin/R myprofile.log
    

    if you issue sourceCpp with verbose=T you'll see the file path and generated object file...

    Building shared library
    --------------------------------------------------------
    
    DIR: /tmp/RtmpyxYB19/sourcecpp_79831e029f
    
    /usr/lib/R/bin/R CMD SHLIB -o 'sourceCpp_2.so' --->8---
    

    so try using (in this instance)

    google-pprof --text /tmp/RtmpyxYB19/sourcecpp_79831e029f/sourceCpp_2.so myprofile.log
    

    0 讨论(0)
提交回复
热议问题