-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplot.R
36 lines (32 loc) · 1.21 KB
/
plot.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
#!/usr/bin/env Rscript
# 20231030WF - init
# read in hyperfine stats for each language. files generted by Makefile
library(dplyr); library(tidyr); library(ggplot2)
benchmarks <-
Sys.glob('out/*/*.csv') |>
lapply(\(f) tryCatch(read.csv(f) %>%
mutate(f=gsub('out/|-stats.csv','',f)),
error=\(e) NULL)) |>
bind_rows()
bclean <- benchmarks |>
separate(f,c('proc','host','app'),sep='[-/]') |>
mutate(impl=gsub(' .*|scripts/','',command) %>%
gsub('.*\\.','',.),
proc=gsub('_+', ' ', proc)) |>
filter(!grepl('target/',impl))
brank <- bclean |>
group_by(proc,host,app) |>
mutate(r=rank(`mean`))
ggplot(brank) +
aes(x=impl, y=`r`,
color=stringr::str_wrap(proc,20),
label=round(`mean`,2)) +
geom_point() +
geom_text(size=2, vjust=1, hjust=-.25, color='black',aes(color=NULL)) +
facet_wrap(~app, scales="free_x") +
cowplot::theme_cowplot() +
labs(title='Preformace Rank per Implementations (lower better)',
x='Implementation', y='Rank', color="Processor")+
theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust=0),
legend.position='top')
ggsave('out/rank_plot.png',width=10.6,height=6)