Full_Name: Kasper Daniel Hansen Version: 1.9.1 OS: linux Submission from: (NULL) (128.32.208.249) summaryRprof gives a very different result than R CMD Rprof. This is because summaryRprof does not record calls starting with a dot, most notably .C calls. Following a suggestion by P.Dalgaard I tried replacing the two ls calls with ls(, all.names = TRUE). IE. the two lines totalt <- sapply(ls(envir = total), function(f) get(f, envir = total)) selft <- sapply(ls(envir = self), function(f) get(f, envir = self)) was replaced with totalt <- sapply(ls(envir = total, all.names= TRUE), function(f) get(f, envir = total)) selft <- sapply(ls(envir = self, all.names = TRUE), function(f) get(f, envir = self)) This seemed to solve the problem.