-
Notifications
You must be signed in to change notification settings - Fork 46
/
Copy pathcpu-tuning.R
60 lines (48 loc) · 1.34 KB
/
cpu-tuning.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
#
# cpu-tuning.R, 19 Aug 16
#
# Data from:
# Software knows best: A case for hardware transparency and measureability
# Bird
#
# Example from:
# Evidence-based Software Engineering: based on the publicly available data
# Derek M. Jones
#
# TAG performance_tuning Intel_cpu
source("ESEUR_config.r")
library("lattice")
cpu_perf=read.csv(paste0(ESEUR_dir, "benchmark/bird_perf-port.csv.xz"), as.is=TRUE)
perf_27=subset(cpu_perf, Points == 27)
perf_27$Points=NULL
rownames(perf_27)=perf_27$CPU
perf_27$CPU=NULL
# add_value=function()
# {
# t=expand.grid(1:6, 1:5)
# text(t, labels=as.vector(t(as.matrix(perf_27))), cex=2.0)
# }
#
#
# par(omi=c(0.1, 0.00, 0.00, 0.4))
#
# It is possible to get heatmap to produce something reasonable
# brew_col=rainbow_hcl(5)
#
# heatmap(as.matrix(perf_27), Rowv=NA, Colv=NA, RowSideColors=brew_col, col=brew_col,
# add.expr=add_value())
perf_27=as.matrix(perf_27)
perf_27=t(perf_27)
t=levelplot(perf_27,
# col.regions=rainbow(100, end=0.9),
# Not as garish
col.regions=rainbow_hcl(100),
scales=list(x=list(cex=0.70, rot=25), y=list(cex=0.65)),
colorkey=NULL, # Numeric values remove the need for legend
xlab="Tuned for", ylab="Executed on",
panel=function(...)
{
panel.levelplot(...)
panel.text(1:6, rep(1:5, each=6), perf_27, cex=0.65)
})
plot(t, panel.height=list(3.8, "cm"), panel.width=list(4.2, "cm"))