1
1
mirror of https://github.com/mgree/ffs.git synced 2024-10-05 15:18:20 +03:00

boxplots for micro benchmark, much cleaner

This commit is contained in:
Michael Greenberg 2021-09-24 15:18:58 -04:00
parent d551f48f17
commit 1f8ec3934b

View File

@ -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)