diff --git a/trainbenchmark/trainbenchmark-reporting/combined.R b/trainbenchmark/trainbenchmark-reporting/combined.R index 7b6e4ffe4b38ba92b0aa5695a2f6c05a1acfefb5..015c2c92abdd2c80c588ae9af44a627f47a7b32d 100644 --- a/trainbenchmark/trainbenchmark-reporting/combined.R +++ b/trainbenchmark/trainbenchmark-reporting/combined.R @@ -81,6 +81,9 @@ for (scenario in c("inject", "repair")) { times.plot$Phase = gsub('\\.', ' ', times.plot$Phase) times.plot$Phase = factor(times.plot$Phase, levels = phasesPrettified) # times.plot$Workload = factor(times.plot$Workload, levels = workloads) + write.csv(times, file = paste("out-", scenario, ".csv", sep="")) + write.csv(times.aggregated.runs, file = paste("out-agg-", scenario, ".csv", sep="")) + write.csv(times.plot, file = paste("out-plot-", scenario, ".csv", sep="")) ### line charts for (phase in phasesPrettified) { @@ -106,7 +109,7 @@ for (scenario in c("inject", "repair")) { # x axis labels xbreaks = unique(df$Model) currentWorkloadSizes = head(workloadSizes, n=length(xbreaks)) - xlabels = paste(xbreaks, "\n", currentWorkloadSizes, sep = "") + xlabels = paste(currentWorkloadSizes, sep = "") # drop every other models size maxLabel = max(log2(max(df$Model)), 2) @@ -127,7 +130,7 @@ for (scenario in c("inject", "repair")) { p = ggplot(df) + #na.omit(df)) + aes(x = as.factor(Model), y = Time) + - labs(title = paste("Individual query execution time,", phase, "phase"), x = "Model size\n#Elements", y = "Execution times [ms]") + + labs(title = paste("Individual query execution time,", phase, "phase"), x = element_blank(), y = element_blank()) +#, x = "Model size\n#Elements", y = "Execution times [ms]") + geom_point(aes(col = Tool, shape = Tool), size = 2.0) + scale_shape_manual( values = c(1,16, 0,15, 2,17, 5,18, 8,10), @@ -167,8 +170,8 @@ for (scenario in c("inject", "repair")) { ) + geom_line(aes(col = Tool, group = Tool), size = 0.5) + # scale_linetype_manual(values=c(0,1,2,3,4,5,6,7,8,9), na.value="blank") + - scale_x_discrete(breaks = xbreaks, labels = xlabels) + - scale_y_log10(breaks = ybreaks, minor_breaks=yminor_breaks, labels = ylabels, limits = c(2e-3,2e4), expand = c(0, 0)) + + scale_x_discrete(breaks = xbreaks, labels = xlabels,expand=c(0.02,0.1)) + + scale_y_log10(breaks = ybreaks, minor_breaks=NULL, labels = ylabels, limits = c(3e-3,3e4), expand = c(0, 0)) + theme_bw() + theme( plot.title = element_blank(), # element_text(hjust = 0.5), @@ -177,13 +180,13 @@ for (scenario in c("inject", "repair")) { legend.title = element_blank(), strip.text.x = element_blank(), legend.position = "none", # "none", # - axis.text = element_text(size = 11) + axis.text = element_text(size = 7) #, panel.grid.minor = element_blank() ) fnTmp <- paste("../diagrams/recent/benchmark/", scenario, "/", phase.filename, "-", scenario, "-tmp.pdf", sep="") fn <- paste("../diagrams/recent/benchmark/", scenario, "/", phase.filename, "-", scenario, ".pdf", sep="") if (phase == "Read") { - p = p + scale_y_log10(breaks = ybreaks, minor_breaks=yminor_breaks, labels = ylabels, limits = c(9e-1,3e4), expand = c(0, 0)) + + p = p + scale_y_log10(breaks = ybreaks, minor_breaks=NULL, labels = ylabels, limits = c(1e0,3e4), expand = c(0, 0)) + scale_colour_manual(values = c( "#56B4E9", "#56B4E9", # Sky blue - Name Lookup "#009E73", "#009E73", # Bluish green - Intrinsic References "#0072B2", "#0072B2", # Blue - Manual Serialization @@ -193,26 +196,26 @@ for (scenario in c("inject", "repair")) { "#F0E442" # Yellow ), labels = c( - "Name Lookup (Reflection-based Serializer)", - "Name Lookup (Reflection-based Serializer, Incremental)", - "Intrinsic References (Modified Reflection-based Serializer)", - "Intrinsic References (Modified Reflection-based Serializer, Incremental)", - "Relational RAGs (Hand-written Serializer)", - "Relational RAGs (Hand-written Serializer, Incremental)", - "Relational RAGs (Generated Serializer)", - "Relational RAGs (Generated Serializer, Incremental)" + "Name Lookup / Reflection-based", + "Name Lookup (Incremental) / Reflection-based", + "Intrinsic References / Modified Reflection-based", + "Intrinsic References (Incremental) / Modified Reflection-based", + "Relational RAGs / Hand-written", + "Relational RAGs (Incremental) / Hand-written", + "Relational RAGs / Generated", + "Relational RAGs (Incremental) / Generated" ) ) + scale_shape_manual( values = c(1,16, 0,15, 2,17, 5,18, 8,10), labels = c( - "Name Lookup (Reflection-based Serializer)", - "Name Lookup (Reflection-based Serializer, Incremental)", - "Intrinsic References (Modified Reflection-based Serializer)", - "Intrinsic References (Modified Reflection-based Serializer, Incremental)", - "Relational RAGs (Hand-written Serializer)", - "Relational RAGs (Hand-written Serializer, Incremental)", - "Relational RAGs (Generated Serializer)", - "Relational RAGs (Generated Serializer, Incremental)" + "Name Lookup / Reflection-based", + "Name Lookup (Incremental) / Reflection-based", + "Intrinsic References / Modified Reflection-based", + "Intrinsic References (Incremental) / Modified Reflection-based", + "Relational RAGs / Hand-written", + "Relational RAGs (Incremental) / Hand-written", + "Relational RAGs / Generated", + "Relational RAGs (Incremental) / Generated" ), guide=guide_legend(ncol=2,nrow=4) ) + @@ -223,9 +226,18 @@ for (scenario in c("inject", "repair")) { legend.title = element_blank(), strip.text.x = element_blank(), legend.position = "right", # "none", # - axis.text = element_text(size = 11) + axis.text = element_text(size = 9) #, panel.grid.minor = element_blank() ) + + p <- p + + # reverse ticks + annotation_logticks(sides = "l", short = unit(- 0.06, "cm"), mid = unit(- 0.10, "cm"), long = unit(- 0.14, "cm")) + + # remove clipping + coord_cartesian(clip = "off") + + # add space between ticks and labels + theme(axis.text.y = element_text(margin = margin(r = 2))) + ggsave( plot = p, filename = fnTmp, @@ -234,11 +246,21 @@ for (scenario in c("inject", "repair")) { units = "mm" ) } else { + + + p <- p + + # reverse ticks + annotation_logticks(sides = "l", short = unit(- 0.07, "cm"), mid = unit(- 0.14, "cm"), long = unit(- 0.21, "cm")) + + # remove clipping + coord_cartesian(clip = "off") + + # add space between ticks and labels + theme(axis.text.y = element_text(margin = margin(r = 4))) + ggsave( plot = p, filename = fnTmp, - width = 100, - height = 130, + width = 78, + height = 104, units = "mm" ) } diff --git a/trainbenchmark/trainbenchmark-reporting/individual.R b/trainbenchmark/trainbenchmark-reporting/individual.R index 3ccd1b0631cbc9351f98824576bc803aaf50706f..e4e985b252beffecf0b5ebd81d5d33669c802d31 100644 --- a/trainbenchmark/trainbenchmark-reporting/individual.R +++ b/trainbenchmark/trainbenchmark-reporting/individual.R @@ -1,6 +1,7 @@ library(data.table) library(reshape2) library(plyr) +library(grid) library(ggplot2) library(ggrepel) library(arules) @@ -106,7 +107,7 @@ for (scenario in c("inject", "repair")) { # x axis labels xbreaks = unique(df$Model) currentWorkloadSizes = head(workloadSizes, n=length(xbreaks)) - xlabels = paste(xbreaks, "\n", currentWorkloadSizes, sep = "") + xlabels = currentWorkloadSizes # drop every other models size maxLabel = max(log2(max(df$Model)), 2) @@ -167,8 +168,8 @@ for (scenario in c("inject", "repair")) { ) + geom_line(aes(col = Tool, group = Tool), size = 0.5) + # scale_linetype_manual(values=c(0,1,2,3,4,5,6,7,8,9), na.value="blank") + - scale_x_discrete(breaks = xbreaks, labels = xlabels) + - scale_y_log10(breaks = ybreaks, minor_breaks=yminor_breaks, labels = ylabels, limits = c(2e-3,2e4), expand = c(0, 0)) + + scale_x_discrete(breaks = xbreaks, labels = xlabels,expand=c(0.02,0.1)) + + scale_y_log10(breaks = ybreaks, minor_breaks = NULL, labels = ylabels, limits = c(3e-3, 3e4), expand = c(0, 0)) + facet_grid_paginate(~ Workload, nrow=1, ncol = 1, page=cpage, scale = "free") + theme_bw() + theme( @@ -178,21 +179,28 @@ for (scenario in c("inject", "repair")) { legend.title = element_blank(), strip.text.x = element_blank(), legend.position = "none", # "none", # - axis.text = element_text(size = 11) + axis.text = element_text(size = 7) #, panel.grid.minor = element_blank() ) - fnTmp <- paste("../diagrams/recent/", scenario, "/", phase.filename, "-", workloads[cpage], "-", scenario, "-tmp.pdf", sep="") - fn <- paste("../diagrams/recent/", scenario, "/", phase.filename, "-", workloads[cpage], "-", scenario, ".pdf", sep="") - ggsave( + p <- p + + # reverse ticks + annotation_logticks(sides = "l", short = unit(- 0.06, "cm"), mid = unit(- 0.10, "cm"), long = unit(- 0.14, "cm")) + + # remove clipping + coord_cartesian(clip = "off") + + # add space between ticks and labels + theme(axis.text.y = element_text(margin = margin(r = 2))) + + fnTmp <- paste("../diagrams/recent/", scenario, "/", phase.filename, "-", workloads[cpage], "-", scenario, "-tmp.pdf", sep = "") + fn <- paste("../diagrams/recent/", scenario, "/", phase.filename, "-", workloads[cpage], "-", scenario, ".pdf", sep = "") + ggsave( plot = p, filename = fnTmp, - width = 100, - height = 130, + width = 78, + height = 104, units = "mm" - ) - embed_fonts(fnTmp, outfile=fn) - file.remove(fnTmp) + ) + embed_fonts(fnTmp, outfile = fn) + file.remove(fnTmp) + } } - - } }