I may suggest this tutorial: http://www.stat.berkeley.edu/~nolan/stat133/Fall05/lectures/profilingEx.html and this discussion: http://stackoverflow.com/questions/3650862/how-to-efficiently-use-rprof-in-r which inspired this example: Rprof("profile1.out", line.profiling=TRUE) for(i in 1:10000) { rnorm(100,1,1); rbinom(1000,1,1) rbinom(10000,1,1) } Rprof(NULL) summaryRprof("profile1.out", lines = "show") $by.self self.time self.pct total.time total.pct #4 4.44 86.72 4.44 86.72 #3 0.38 7.42 0.38 7.42 #2 0.30 5.86 0.30 5.86 $by.total total.time total.pct self.time self.pct #4 4.44 86.72 4.44 86.72 #3 0.38 7.42 0.38 7.42 #2 0.30 5.86 0.30 5.86 $by.line self.time self.pct total.time total.pct #2 0.30 5.86 0.30 5.86 #3 0.38 7.42 0.38 7.42 #4 4.44 86.72 4.44 86.72 $sample.interval [1] 0.02 $sampling.time [1] 5.12 -- GG [[alternative HTML version deleted]]