-
Notifications
You must be signed in to change notification settings - Fork 0
/
analysis.R
94 lines (88 loc) · 2.89 KB
/
analysis.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
library(tidyverse)
library(ggpubr)
dt <- read_csv("log/log.csv") %>%
mutate(
Instructions = Instructions / Rounds / Tasks,
Cycles = Cycles / Rounds / Tasks,
Time = Time / Rounds / Tasks * 1e9,
Mode = if_else(Threads == TRUE, "Threads", "Processes"),
) %>%
select(-Threads)
dt_over <-
dt %>%
pivot_wider(names_from = Mode, values_from = Time) %>%
group_by(CPU) %>%
summarise(
Position = max(na.omit(Processes), na.omit(Threads)),
Relative = na.omit(Processes) / na.omit(Threads),
Absolute = na.omit(Processes) - na.omit(Threads),
)
dt %>%
ggplot(aes(x = CPU, y = Time, fill = Mode)) +
geom_bar(stat = "identity", position = "dodge") +
geom_label(
data = dt_over,
inherit.aes = FALSE,
aes(
x = CPU,
y = Position,
label = paste0("x", round(Relative, 1), " (", round(Absolute, 1), " ns)"),
),
position = position_dodge(width = 1),
vjust = -0.5,
) +
labs(x = "CPU", y = "Time, ns") +
theme_pubr() %+replace% theme(legend.position = "bottom")
ggsave("log/cs_time.png", width = 10, height = 10)
dt_over <-
dt %>%
pivot_wider(names_from = Mode, values_from = Instructions) %>%
group_by(CPU) %>%
summarise(
Position = max(na.omit(Processes), na.omit(Threads)),
Relative = na.omit(Processes) / na.omit(Threads),
Absolute = na.omit(Processes) - na.omit(Threads),
)
dt %>%
ggplot(aes(x = CPU, y = Instructions, fill = Mode)) +
geom_bar(stat = "identity", position = "dodge") +
geom_label(
data = dt_over,
inherit.aes = FALSE,
aes(
x = CPU,
y = Position,
label = paste0("x", round(Relative, 2), " (", round(Absolute, 1), " instr)"),
),
position = position_dodge(width = 1),
vjust = -0.5,
) +
labs(x = "CPU", y = "Instructions") +
theme_pubr() %+replace% theme(legend.position = "bottom")
ggsave("log/cs_instr.png", width = 10, height = 10)
dt_over <-
dt %>%
pivot_wider(names_from = Mode, values_from = Cycles) %>%
group_by(CPU) %>%
summarise(
Position = max(na.omit(Processes), na.omit(Threads)),
Relative = na.omit(Processes) / na.omit(Threads),
Absolute = na.omit(Processes) - na.omit(Threads),
)
dt %>%
ggplot(aes(x = CPU, y = Cycles, fill = Mode)) +
geom_bar(stat = "identity", position = "dodge") +
geom_label(
data = dt_over,
inherit.aes = FALSE,
aes(
x = CPU,
y = Position,
label = paste0("x", round(Relative, 2), " (", round(Absolute, 1), " cycles)"),
),
position = position_dodge(width = 1),
vjust = -0.5,
) +
labs(x = "CPU", y = "Cycles") +
theme_pubr() %+replace% theme(legend.position = "bottom")
ggsave("log/cs_cycles.png", width = 10, height = 10)