-
Notifications
You must be signed in to change notification settings - Fork 29
/
Makefile
169 lines (120 loc) · 5.77 KB
/
Makefile
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
TOP := $(shell pwd)
WORK := $(TOP)/work
# set these two values to the tags (or revisions) you wish to compare
OLD := go1.2.2
NEW := go1.3
GO_CHECKOUT=$(WORK)/go
GO_OLD_ROOT=$(WORK)/$(OLD)
GO_OLD_BIN=$(GO_OLD_ROOT)/bin/go
GO_NEW_ROOT=$(WORK)/$(NEW)
GO_NEW_BIN=$(GO_NEW_ROOT)/bin/go
GO1_BENCH=$(GO_NEW_ROOT)/test/bench/go1
# uncomment to benchmark with gccgo
# TESTFLAGS=-compiler=gccgo
all: bench
# setup our benchmarking environment
GOPATH=$(TOP)
export GOPATH
unexport GOROOT GOBIN
BENCHCMP=$(TOP)/bin/benchcmp
bench: go1 runtime http floats cipher megajson snappy
extra: bench bytes strings goquery
go1: $(WORK)/go1-$(OLD).txt $(WORK)/go1-$(NEW).txt $(BENCHCMP)
@echo "# go1"
@$(BENCHCMP) $(WORK)/go1-$(OLD).txt $(WORK)/go1-$(NEW).txt
runtime: $(WORK)/runtime-$(OLD).txt $(WORK)/runtime-$(NEW).txt $(BENCHCMP)
@echo "# runtime"
@$(BENCHCMP) $(WORK)/runtime-$(OLD).txt $(WORK)/runtime-$(NEW).txt
bytes: $(WORK)/bytes-$(OLD).txt $(WORK)/bytes-$(NEW).txt $(BENCHCMP)
@echo "# bytes"
@$(BENCHCMP) $(WORK)/bytes-$(OLD).txt $(WORK)/bytes-$(NEW).txt
cipher: $(WORK)/cipher-$(OLD).txt $(WORK)/cipher-$(NEW).txt $(BENCHCMP)
@echo "# cipher"
@$(BENCHCMP) $(WORK)/cipher-$(OLD).txt $(WORK)/cipher-$(NEW).txt
strings: $(WORK)/strings-$(OLD).txt $(WORK)/strings-$(NEW).txt $(BENCHCMP)
@echo "# strings"
@$(BENCHCMP) $(WORK)/strings-$(OLD).txt $(WORK)/strings-$(NEW).txt
http: $(WORK)/http-$(OLD).txt $(WORK)/http-$(NEW).txt $(BENCHCMP)
@echo "# http"
@$(BENCHCMP) $(WORK)/http-$(OLD).txt $(WORK)/http-$(NEW).txt
floats: $(WORK)/floats-$(OLD).txt $(WORK)/floats-$(NEW).txt $(BENCHCMP)
@echo "# floats"
@$(BENCHCMP) $(WORK)/floats-$(OLD).txt $(WORK)/floats-$(NEW).txt
megajson: $(WORK)/megajson-$(OLD).txt $(WORK)/megajson-$(NEW).txt $(BENCHCMP)
@echo "#megajson"
@$(BENCHCMP) $(WORK)/megajson-$(OLD).txt $(WORK)/megajson-$(NEW).txt
snappy: $(WORK)/snappy-$(OLD).txt $(WORK)/snappy-$(NEW).txt $(BENCHCMP)
@echo "#snappy"
@$(BENCHCMP) $(WORK)/snappy-$(OLD).txt $(WORK)/snappy-$(NEW).txt
goquery: $(WORK)/goquery-$(OLD).txt $(WORK)/goquery-$(NEW).txt $(BENCHCMP)
@echo "#goquery"
@$(BENCHCMP) $(WORK)/goquery-$(OLD).txt $(WORK)/goquery-$(NEW).txt
update-$(GO_CHECKOUT): $(GO_CHECKOUT)
hg pull --cwd $(GO_CHECKOUT) -u
update: update-$(GO_CHECKOUT) $(GO_OLD_ROOT) $(GO_NEW_ROOT)
hg pull --cwd $(GO_OLD_ROOT) -u
hg pull --cwd $(GO_NEW_ROOT) -u
rm -rf $(GO_OLD_ROOT)/bin $(GO_NEW_ROOT)/bin
rm -f $(WORK)/*.txt
$(GO_CHECKOUT):
hg clone https://code.google.com/p/go $@
$(GO_OLD_ROOT): $(GO_CHECKOUT)
hg clone -r $(OLD) $(GO_CHECKOUT) $@
$(GO_OLD_BIN): $(GO_OLD_ROOT)
cd $(GO_OLD_ROOT)/src ; ./make.bash
$(GO_NEW_ROOT): $(GO_CHECKOUT)
hg clone -r tip $(GO_CHECKOUT) $@
$(GO_NEW_BIN): $(GO_NEW_ROOT)
cd $(GO_NEW_ROOT)/src ; ./make.bash
$(GO1_BENCH): $(GO_NEW_ROOT)
$(BENCHCMP): $(GO_NEW_BIN)
cd $(GO_NEW_ROOT); ./bin/go get code.google.com/p/go.tools/cmd/benchcmp
$(WORK)/go1-$(OLD).txt: $(GO_OLD_BIN) $(GO1_BENCH)
cd $(GO1_BENCH) && $(GO_OLD_BIN) test $(TESTFLAGS) -bench=. > $@
$(WORK)/go1-$(NEW).txt: $(GO_NEW_BIN) $(GO1_BENCH)
cd $(GO1_BENCH) && $(GO_NEW_BIN) test $(TESTFLAGS) -bench=. > $@
$(WORK)/runtime-$(OLD).txt: $(GO_OLD_BIN)
$(GO_OLD_BIN) test $(TESTFLAGS) -test.run=XXX -test.bench=. bench/runtime > $@
$(WORK)/runtime-$(NEW).txt: $(GO_NEW_BIN)
$(GO_NEW_BIN) test $(TESTFLAGS) -test.run=XXX -test.bench=. bench/runtime > $@
$(WORK)/http-$(OLD).txt: $(GO_OLD_BIN)
$(GO_OLD_BIN) test $(TESTFLAGS) -test.run=XXX -test.bench=. bench/http > $@
$(WORK)/http-$(NEW).txt: $(GO_NEW_BIN)
$(GO_NEW_BIN) test $(TESTFLAGS) -test.run=XXX -test.bench=. bench/http > $@
$(WORK)/cipher-$(OLD).txt: $(GO_OLD_BIN)
$(GO_OLD_BIN) test $(TESTFLAGS) -test.run=XXX -test.bench=. bench/cipher > $@
$(WORK)/cipher-$(NEW).txt: $(GO_NEW_BIN)
$(GO_NEW_BIN) test $(TESTFLAGS) -test.run=XXX -test.bench=. bench/cipher > $@
$(WORK)/bytes-$(OLD).txt: $(GO_OLD_BIN)
$(GO_OLD_BIN) test $(TESTFLAGS) -test.run=XXX -test.bench=. bytes > $@
$(WORK)/bytes-$(NEW).txt: $(GO_NEW_BIN)
$(GO_NEW_BIN) test $(TESTFLAGS) -test.run=XXX -test.bench=. bytes > $@
$(WORK)/strings-$(OLD).txt: $(GO_OLD_BIN)
$(GO_OLD_BIN) test $(TESTFLAGS) -test.run=XXX -test.bench=. strings > $@
$(WORK)/strings-$(NEW).txt: $(GO_NEW_BIN)
$(GO_NEW_BIN) test $(TESTFLAGS) -test.run=XXX -test.bench=. strings > $@
$(WORK)/floats-$(OLD).txt: $(GO_OLD_BIN)
$(GO_OLD_BIN) test $(TESTFLAGS) -test.run=XXX -test.bench=. bench/floats > $@
$(WORK)/floats-$(NEW).txt: $(GO_NEW_BIN)
$(GO_NEW_BIN) test $(TESTFLAGS) -test.run=XXX -test.bench=. bench/floats > $@
$(WORK)/megajson-$(OLD).txt: $(GO_OLD_BIN)
$(GO_OLD_BIN) get -u -v -d github.com/benbjohnson/megajson
cd $(GOPATH)/src/github.com/benbjohnson/megajson/.bench && $(GO_OLD_BIN) test $(TESTFLAGS) -test.run=XXX -test.bench=. . > $@
$(WORK)/megajson-$(NEW).txt: $(GO_NEW_BIN)
$(GO_NEW_BIN) get -u -v -d github.com/benbjohnson/megajson
cd $(GOPATH)/src/github.com/benbjohnson/megajson/.bench && $(GO_OLD_BIN) test $(TESTFLAGS) -test.run=XXX -test.bench=. . > $@
$(WORK)/snappy-$(OLD).txt: $(GO_OLD_BIN)
$(GO_OLD_BIN) get -u -v -d code.google.com/p/snappy-go/snappy
$(GO_OLD_BIN) test $(TESTFLAGS) -test.run=XXX -test.bench='.*'. code.google.com/p/snappy-go/snappy > $@
$(WORK)/snappy-$(NEW).txt: $(GO_NEW_BIN)
$(GO_NEW_BIN) get -u -v -d code.google.com/p/snappy-go/snappy
$(GO_NEW_BIN) test $(TESTFLAGS) -test.run=XXX -test.bench='.*' code.google.com/p/snappy-go/snappy > $@
$(WORK)/goquery-$(OLD).txt: $(GO_OLD_BIN)
$(GO_OLD_BIN) get -u -v -d github.com/PuerkitoBio/goquery
$(GO_OLD_BIN) test $(TESTFLAGS) -test.run=XXX -test.bench='.*'. github.com/PuerkitoBio/goquery > $@
$(WORK)/goquery-$(NEW).txt: $(GO_NEW_BIN)
$(GO_NEW_BIN) get -u -v -d github.com/PuerkitoBio/goquery
$(GO_NEW_BIN) test $(TESTFLAGS) -test.run=XXX -test.bench='.*' github.com/PuerkitoBio/goquery > $@
clean:
rm -f $(WORK)/*.txt
.PHONEY: $(BENCHCMP) tip