Skip to content

Commit

Permalink
boxplots for micro benchmark, much cleaner
Browse files Browse the repository at this point in the history
  • Loading branch information
mgree committed Sep 24, 2021
1 parent d551f48 commit 1f8ec39
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions bench/generate_charts.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@ ggsave(gsub("log","png",args[1]), benchPlot, width=4.5, height=4.5)

micro <- data.frame(read.csv(args[2]))
micro$activity <- factor(micro$activity, levels = c("reading", "loading", "saving", "writing"))
microPlot <- ggplot(micro) +
xlab("JSON value size") + ylab("Time (ms, log10)") + scale_colour_discrete(name = "Activity") + scale_shape_discrete(name = "Kind") +
scale_x_continuous(limits=c(0,8), breaks=c(0,2,4,6,8), labels=c("1", "4", "16", "64", "256")) +
microPlot <-
ggplot(micro, aes(x=factor(log(magnitude, base=2)), y=log(ns,base=10), color=factor(activity))) +
xlab("JSON value size") + ylab("Time (ms, log10)") +
scale_colour_discrete(name = "Activity") +
scale_shape_discrete(name = "Kind") +
scale_x_discrete(labels=c("1", "2", "4", "8", "16", "32", "64", "128", "256")) +
scale_y_continuous(breaks=c(0,2,4,6,8,10),labels=c("0ms", "0.01ms", "0.1ms", "1ms", "10ms", "100ms")) +
geom_point(aes(log(magnitude,base=2),log(ns,base=10),colour=activity,shape=kind)) +
facet_wrap( ~ direction, labeller = as_labeller(c(`deep` = "Deep { { ... } }", `wide` = "Wide { ..., ... }")))
geom_boxplot(outlier.size=0.3) +
facet_wrap( ~ direction, labeller = as_labeller(c(`deep` = "Deep { { ... } }", `wide` = "Wide { ..., ... }"))) +
theme(legend.position="bottom", legend.title=element_blank())

ggsave(gsub("log","png",args[2]), microPlot, width=4.5, height=4.5)

0 comments on commit 1f8ec39

Please sign in to comment.