@@ -7,24 +7,33 @@ draw_plot <- function(name, displayName, iguana, antlr) {
7
7
output <- paste(name , " .pdf" , sep = " " )
8
8
pdf(output , width = 12 , height = 6 , family = " CM Roman" )
9
9
10
- boxplot(iguana $ Score , antlr $ Score , horizontal = TRUE , names = c(" Iguana" , " ANTLR" ), las = 2 , outline = FALSE , main = displayName , xlab = " Running time (milliseconds)" )
10
+ boxplot(iguana $ Score , antlr $ Score , horizontal = TRUE , names = c(" Iguana" , " ANTLR" ), outline = FALSE , main = displayName , xlab = " Running time (milliseconds)" )
11
11
text(x = boxplot.stats(round(iguana $ Score , 2 ))$ stats , labels = boxplot.stats(round(iguana $ Score , 2 ))$ stats , y = 0.55 )
12
12
text(x = boxplot.stats(round(antlr $ Score , 2 ))$ stats , labels = boxplot.stats(round(antlr $ Score , 2 ))$ stats , y = 1.55 )
13
13
14
14
dev.off()
15
15
}
16
16
17
+ draw_relative_plot <- function (name , displayName , data ) {
18
+ output <- paste(name , " .pdf" , sep = " " )
19
+ pdf(output , width = 12 , height = 6 , family = " CM Roman" )
20
+
21
+ boxplot(data , horizontal = TRUE , names = c(" Relative performance" ), outline = FALSE )
22
+ text(x = boxplot.stats(round(data , 2 ))$ stats , labels = boxplot.stats(round(data , 2 ))$ stats , y = 0.55 )
23
+
24
+ dev.off()
25
+ }
26
+
17
27
names <- c(" RxJava" , " elasticsearch" , " jdk7u-jdk" , " guava" , " junit4" )
18
28
displayNames <- c(" RxJava" , " Elastic Search" , " OpenJDK 7" , " Guava" , " Junit 4" )
19
29
20
30
total_iguana <- data.frame ()
21
31
total_antlr <- data.frame ()
32
+ total_relative <- c()
22
33
23
34
for (i in 1 : length(names )) {
24
35
name <- names [i ]
25
36
displayName <- displayNames [i ]
26
- output <- paste(name , " .pdf" , sep = " " )
27
- pdf(output , width = 12 , height = 8 , family = " CM Roman" )
28
37
29
38
iguana <- read.csv(paste(" Iguana_" , name , " .csv" , sep = " " ), header = TRUE , sep = " ," , dec = " ," , stringsAsFactors = FALSE )
30
39
iguana [, " Score" ] <- as.numeric(iguana [, " Score" ])
@@ -34,11 +43,32 @@ for (i in 1:length(names)) {
34
43
antlr [, " Score" ] <- as.numeric(antlr [, " Score" ])
35
44
total_antlr <- rbind(total_antlr , antlr )
36
45
46
+ print(length(iguana $ Score ))
47
+ print(length(antlr $ Score ))
48
+
37
49
draw_plot(name , displayName , iguana , antlr )
38
50
}
39
51
52
+ for (i in 1 : length(names )) {
53
+ name <- names [i ]
54
+ displayName <- displayNames [i ]
55
+
56
+ iguana <- read.csv(paste(" Iguana_" , name , " .csv" , sep = " " ), header = TRUE , sep = " ," , dec = " ," , stringsAsFactors = FALSE )
57
+ iguana [, " Score" ] <- as.numeric(iguana [, " Score" ])
58
+
59
+ antlr <- read.csv(paste(" Antlr_" , name , " .csv" , sep = " " ), header = TRUE , sep = " ," , dec = " ," , stringsAsFactors = FALSE )
60
+ antlr [, " Score" ] <- as.numeric(antlr [, " Score" ])
61
+
62
+ relative <- iguana $ Score / antlr $ Score
63
+ total_relative <- c(total_relative , relative )
64
+
65
+ draw_relative_plot(paste(" relative_" , name , sep = " " ), displayName , relative )
66
+ }
67
+
40
68
draw_plot(" total" , " All Files" , total_iguana , total_antlr )
41
69
70
+ draw_relative_plot(" relative_total" , " All Files" , total_relative )
71
+
42
72
for (name in names ) {
43
73
output <- paste(name , " .pdf" , sep = " " )
44
74
embedded_output <- paste(" embedded_" , output , sep = " " )
0 commit comments