Hello!

I have run Rprof on a function of mine and the results look very strange, 
to say the least. At the end I of this email is an output of summaryRprof. Can someone help me interpret this output? I have read the appropriate section in the manual "Writing R Extensions" and help pages. 

 

If I understand this output correctly, it is saying that "unlist" has been active in every interval and all functions or the functions they have called have been active in every interval. Is that correct?

It seams strange that the larges time is 0.02, since the function that was Rprof-ed ran for at least an hour if not more.

 

I am also surprised that some functions are not listed here, especially "for", "if", "as.character", and some others.

 

Could it be that this is the result of the type of my function? The function that was originally called is "opt.random.par". This function in turn called function "opt.par.check.to.skip.iter" via "do.call" 100 times in a "for" loop. This later function calls function "crit.fun" form about 70 to 300 times with double "for" loop in each iteration and does usually do 1 to 10 iterations. This "crit.fun" itself is quite quick, on these data it takes about 0.04s. 

 

I know it would be helpful to provide the functions and the data that produced this results, however I can not disclose them at this point. 

 

Thank you in advance for any suggestions.

Ales Ziberna




output of summaryRprof:
$by.self
                           self.time self.pct total.time total.pct
unlist                          0.02      100       0.02       100
any                             0.00        0       0.02       100
crit.fun                        0.00        0       0.02       100
diag                            0.00        0       0.02       100
do.call                         0.00        0       0.02       100
opt.par.check.to.skip.iter      0.00        0       0.02       100
opt.random.par                  0.00        0       0.02       100
sapply                          0.00        0       0.02       100
sum                             0.00        0       0.02       100

$by.total
                           total.time total.pct self.time self.pct
unlist                           0.02       100      0.02      100
any                              0.02       100      0.00        0
crit.fun                         0.02       100      0.00        0
diag                             0.02       100      0.00        0
do.call                          0.02       100      0.00        0
opt.par.check.to.skip.iter       0.02       100      0.00        0
opt.random.par                   0.02       100      0.00        0
sapply                           0.02       100      0.00        0
sum                              0.02       100      0.00        0

$sampling.time
[1] 0.02

	[[alternative HTML version deleted]]


