I am trying to get some performance benchmarks for my code and have run both tictoc and prolifvis over the entire script.
The 'time elapsed' in seconds as shown by tictoc seems to give the absolute time elapsed when the code was run. However the time given in milliseconds by prolifvis is much shorter.
For example, tictoc tells me the time elapsed is 30.75secs but prolifvis shows only 410ms. This particular example is for scripts that produce plots with ggplot but other files that perform basic analyses on a dataframe show the same kind of difference
What exactly is prolifvis measuring?
tic()
df <- data.frame(var=c("a", "b", "c"),
nums=c(1:3))
plot2 <- ggplot(df, aes(x=var, y=nums)) +
geom_bar(stat = "identity")
print(plot2)
toc()
profvis(expr = {
df <- data.frame(var=c("a", "b", "c"),
nums=c(1:3))
plot2 <- ggplot(df, aes(x=var, y=nums)) +
geom_bar(stat = "identity")
print(plot2)
}, interval = 0.01, prof_output = "*_file")
Example taken from http://r-statistics.co/ggplot2-Tutorial-With-R.html