-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathBENCHMARK_2.results.R
119 lines (107 loc) · 3.26 KB
/
BENCHMARK_2.results.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
library(ggplot2)
library(tidyr)
library(dplyr)
library(RColorBrewer)
library(dichromat)
d <- read.csv('BENCHMARK_2.results.csv',header=FALSE,sep='\t',stringsAsFactors=FALSE)
names(d) <- c('Program','file','tokens','construct','search')
d <- d %>%
group_by(Program,file) %>%
summarise(Construct = min(construct), Search=min(search)) %>%
extract(file,c('filetype','filelines'),'(\\w+).(\\d)mil') %>%
mutate(lines=as.integer(filelines)*10^6) %>%
gather(time_type,time,Construct,Search) %>%
select(-filelines)
d$Program <- sub('.*(R-3.2.2).*','\\1',d$Program)
d$Program <- sub('.*(R-Array-Hash).*','\\1',d$Program)
d$Program <- sub('^C$','C-Array-Hash',d$Program)
d$Program <- sub('^python$','Python-Dict',d$Program)
d$Program <- sub('^julia$','Julia-Dict',d$Program)
prog_color <- brewer.pal(n=12,name='Paired')[c(1,2,5,6,9,10)]
names(prog_color) <- c('C-Array-Hash','C-Dense-Hash','Python-Dict','Julia-Dict','R-Array-Hash','R-3.2.2')
prog_sub <- c('C-Array-Hash','Python-Dict','C-Dense-Hash')
py_c_dist <-
ggplot(
d %>% filter(filetype=='DISTINCT',Program %in% prog_sub),
aes(x=lines,y=time)
) +
geom_line(aes(colour=Program)) +
geom_point(aes(colour=Program)) +
labs(x='',y='',title='DISTINCT') +
theme(
axis.text = element_text(colour = "black")
) +
scale_color_manual(values=prog_color) +
facet_grid (. ~ time_type)
png(filename='C_Python_Distinct.png',width=600,height=300)
print(py_c_dist)
dev.off()
py_c_skew <-
ggplot(
d %>% filter(filetype=='SKEW',Program %in% prog_sub),
aes(x=lines,y=time)
) +
geom_line(aes(colour=Program)) +
geom_point(aes(colour=Program)) +
labs(x='',y='',title='SKEW') +
theme(
axis.text = element_text(colour = "black")
) +
scale_color_manual(values=prog_color) +
facet_grid (. ~ time_type)
png(filename='C_Python_Skew.png',width=600,height=300)
print(py_c_skew)
dev.off()
prog_sub <- c('C-Array-Hash','C-Dense-Hash')
c_dist <-
ggplot(
d %>% filter(filetype=='DISTINCT',Program %in% prog_sub),
aes(x=lines,y=time)
) +
geom_line(aes(colour=Program)) +
geom_point(aes(colour=Program)) +
labs(x='',y='',title='DISTINCT') +
theme(
axis.text = element_text(colour = "black")
) +
scale_color_manual(values=prog_color) +
facet_grid (. ~ time_type)
png(filename='C_Distinct.png',width=600,height=300)
print(c_dist)
dev.off()
c_skew <-
ggplot(
d %>% filter(filetype=='SKEW',Program %in% prog_sub),
aes(x=lines,y=time)
) +
geom_line(aes(colour=Program)) +
geom_point(aes(colour=Program)) +
labs(x='',y='',title='SKEW') +
theme(
axis.text = element_text(colour = "black")
) +
scale_color_manual(values=prog_color) +
facet_grid (. ~ time_type)
png(filename='C_Skew.png',width=600,height=300)
print(c_skew)
dev.off()
all_dist <-
ggplot(
d %>% filter(filetype=='DISTINCT'),
aes(x=lines,y=time)
) +
labs(
title="Performance of Hash Table with Distinct Keys",
x="Number of Elements in Table",
y="Time in Seconds") +
geom_line(aes(colour=Program)) +
geom_point(aes(colour=Program)) +
theme(
axis.text = element_text(colour = "black")
) +
scale_color_manual(values=prog_color) +
scale_y_log10(breaks=c(0.5,1,5,50,100,150,1000)) +
facet_grid (. ~ time_type)
png(filename='All_Distinct.png',width=600,height=400)
print(all_dist)
dev.off()