karpfen
karpfen

Reputation: 499

How to measure the time of individual function calls in a large R project?

I have a somewhat large R project and would like to identify performance bottlenecks by measuring how long the individual functions take to execute. I know of tools like microbenchmark for checking individual lines of code.

Is it possible to have a tool track the execution times of the individually called functions and then report the results at the end?

In practice, the idea would be that I have a script.R

plot(cars)
plot(cars + 1)

and after running the "benchmark tool" over it, get a result that looks something like this:

plot(cars): 0.1s
plot(cars + 1): 0.1s

How would I go about achieving something like this?

Upvotes: 0

Views: 219

Answers (0)

Related Questions