diff --git a/perf.R b/perf.R
index 2dce9208149434acc2efc3d044e0ccaade9311d4..b379388f8a656240fc0f8ae2b9986b016ea38238 100644
--- a/perf.R
+++ b/perf.R
@@ -1,6 +1,10 @@
 library(microbenchmark)
 
-mb <- microbenchmark(
+mb <- microbenchmark::microbenchmark(
+  "clear" = {
+    rm(list = ls())
+    lapply(paste('package:', names(sessionInfo()$otherPkgs), sep=""), detach, character.only=TRUE, unload=TRUE)
+    },
   "load packages" = {
     library(shinydashboard)
     library(glue)
@@ -68,7 +72,10 @@ mb <- microbenchmark(
     p <- plot_clust(physeq = data, dist = "unifrac", method = "ward.D2", color = "EnvType")
     plot(p)
   },
-  times = 100,  unit = 's', order = 'inorder', warmup = 0)
+  times = 100, unit = "s", control = list(order="inorder"))
 
 mb
-autoplot(mb)
+save(mb, file = "benchmark.RData")
+
+mb_plot <- microbenchmark::autoplot.microbenchmark(mb)
+ggsave("benchmark.png", plot = mb_plot)