File: Makefile

package info (click to toggle)
golang-github-segmentio-encoding 0.5.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 14,468 kB
  • sloc: makefile: 286
file content (244 lines) | stat: -rw-r--r-- 13,953 bytes parent folder | download
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
benchmark.dir ?= results
benchmark.batch ?= 1000
benchmark.count ?= 8

benchmark.encoding.json := $(benchmark.dir)/encoding-json
benchmark.github.com.json-iterator.go := $(benchmark.dir)/json-iterator
benchmark.github.com.segmentio.encoding.json := $(benchmark.dir)/segment-encoding-json
benchmark.github.com.mailru.easyjson := $(benchmark.dir)/easyjson
benchmark.github.com.protobuf.v1 := $(benchmark.dir)/segment-protobuf-v1
benchmark.vmihailenco.msgpack := $(benchmark.dir)/vmihailenco-msgpack
benchmark.tinylib.msgp := $(benchmark.dir)/tinylib-msgp

benchmark.encoding.json.gzip := $(benchmark.dir)/encoding-json+gzip
benchmark.github.com.json-iterator.go.gzip := $(benchmark.dir)/json-iterator+gzip
benchmark.github.com.segmentio.encoding.json.gzip := $(benchmark.dir)/segment-encoding-json+gzip
benchmark.github.com.mailru.easyjson.gzip := $(benchmark.dir)/easyjson+gzip
benchmark.github.com.protobuf.v1.gzip := $(benchmark.dir)/segment-protobuf-v1+gzip
benchmark.vmihailenco.msgpack.gzip := $(benchmark.dir)/vmihailenco-msgpack+gzip
benchmark.tinylib.msgp.gzip := $(benchmark.dir)/tinylib-msgp+gzip

benchmark.encoding.json.snappy := $(benchmark.dir)/encoding-json+snappy
benchmark.github.com.json-iterator.go.snappy := $(benchmark.dir)/json-iterator+snappy
benchmark.github.com.segmentio.encoding.json.snappy := $(benchmark.dir)/segment-encoding-json+snappy
benchmark.github.com.mailru.easyjson.snappy := $(benchmark.dir)/easyjson+snappy
benchmark.github.com.protobuf.v1.snappy := $(benchmark.dir)/segment-protobuf-v1+snappy
benchmark.vmihailenco.msgpack.snappy := $(benchmark.dir)/vmihailenco-msgpack+snappy
benchmark.tinylib.msgp.snappy := $(benchmark.dir)/tinylib-msgp+snappy

benchmark.encoding.json.zstd := $(benchmark.dir)/encoding-json+zstd
benchmark.github.com.json-iterator.go.zstd := $(benchmark.dir)/json-iterator+zstd
benchmark.github.com.segmentio.encoding.json.zstd := $(benchmark.dir)/segment-encoding-json+zstd
benchmark.github.com.mailru.easyjson.zstd := $(benchmark.dir)/easyjson+zstd
benchmark.github.com.protobuf.v1.zstd := $(benchmark.dir)/segment-protobuf-v1+zstd
benchmark.vmihailenco.msgpack.zstd := $(benchmark.dir)/vmihailenco-msgpack+zstd
benchmark.tinylib.msgp.zstd := $(benchmark.dir)/tinylib-msgp+zstd

benchmark.data := ../json/testdata/msgs.json.gz
benchmark.msgs := $(benchmark.dir)/msgs.json
benchmark.bin := $(benchmark.dir)/benchmark
benchmark.cmd.dir := cmd/benchmark
benchmark.src := $(wildcard ./$(benchmark.cmd.dir)/*.go)
benchmark.out := \
	$(benchmark.encoding.json).txt \
	$(benchmark.github.com.json-iterator.go).txt \
	$(benchmark.github.com.segmentio.encoding.json).txt \
	$(benchmark.github.com.mailru.easyjson).txt \
	$(benchmark.github.com.protobuf.v1).txt \
	$(benchmark.vmihailenco.msgpack).txt \
	$(benchmark.tinylib.msgp).txt \
	$(benchmark.encoding.json.gzip).txt \
	$(benchmark.github.com.json-iterator.go.gzip).txt \
	$(benchmark.github.com.segmentio.encoding.json.gzip).txt \
	$(benchmark.github.com.mailru.easyjson.gzip).txt \
	$(benchmark.github.com.protobuf.v1.gzip).txt \
	$(benchmark.vmihailenco.msgpack.gzip).txt \
	$(benchmark.tinylib.msgp.gzip).txt \
	$(benchmark.encoding.json.snappy).txt \
	$(benchmark.github.com.json-iterator.go.snappy).txt \
	$(benchmark.github.com.segmentio.encoding.json.snappy).txt \
	$(benchmark.github.com.mailru.easyjson.snappy).txt \
	$(benchmark.github.com.protobuf.v1.snappy).txt \
	$(benchmark.vmihailenco.msgpack.snappy).txt \
	$(benchmark.tinylib.msgp.snappy).txt \
	$(benchmark.encoding.json.zstd).txt \
	$(benchmark.github.com.json-iterator.go.zstd).txt \
	$(benchmark.github.com.segmentio.encoding.json.zstd).txt \
	$(benchmark.github.com.mailru.easyjson.zstd).txt \
	$(benchmark.github.com.protobuf.v1.zstd).txt \
	$(benchmark.vmihailenco.msgpack.zstd).txt \
	$(benchmark.tinylib.msgp.zstd).txt

benchstat := ${GOPATH}/bin/benchstat

all:

$(benchstat):
	go install golang.org/x/perf/cmd/benchstat@latest

$(benchmark.cmd.dir)/message.pb.go: $(benchmark.cmd.dir)/message.proto
	@protoc -I. \
		-I$(GOPATH)/src \
		-I$(GOPATH)/src/github.com/gogo/protobuf/protobuf \
		--gogofaster_out=\
Mgoogle/protobuf/struct.proto=github.com/gogo/protobuf/types,\
Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types:.\
		$(benchmark.cmd.dir)/message.proto

bench: $(benchstat) $(benchmark.out)
	@for file in $(benchmark.out); do \
		echo '======' $$(basename $$file | sed 's/.txt//') '======'; \
		cat $$(echo $$file | sed 's/.txt/.log/'); \
		echo; \
		$(benchstat) $(benchmark.encoding.json).txt $$file; \
		echo; \
	done

$(benchmark.dir):
	mkdir -p $(benchmark.dir)

$(benchmark.bin): $(benchmark.src)
	go build -o $(benchmark.bin) ./$(benchmark.cmd.dir)

$(benchmark.msgs): $(benchmark.dir) $(benchmark.data)
	cat $(benchmark.data) | gzip -d > $(benchmark.msgs)

$(benchmark.encoding.json).txt: $(benchmark.msgs) $(benchmark.bin)
	cat $(benchmark.msgs) | $(benchmark.bin) -count $(benchmark.count) -batch $(benchmark.batch) -package encoding/json \
		1> $(benchmark.encoding.json).txt \
		2> $(benchmark.encoding.json).log

$(benchmark.github.com.json-iterator.go).txt: $(benchmark.msgs) $(benchmark.bin)
	cat $(benchmark.msgs) | $(benchmark.bin) -count $(benchmark.count) -batch $(benchmark.batch) -package github.com/json-iterator/go \
		1> $(benchmark.github.com.json-iterator.go).txt \
		2> $(benchmark.github.com.json-iterator.go).log

$(benchmark.github.com.segmentio.encoding.json).txt: $(benchmark.msgs) $(benchmark.bin)
	cat $(benchmark.msgs) | $(benchmark.bin) -count $(benchmark.count) -batch $(benchmark.batch) -package github.com/segmentio/encoding/json \
		1> $(benchmark.github.com.segmentio.encoding.json).txt \
		2> $(benchmark.github.com.segmentio.encoding.json).log

$(benchmark.github.com.mailru.easyjson).txt: $(benchmark.msgs) $(benchmark.bin)
	cat $(benchmark.msgs) | $(benchmark.bin) -count $(benchmark.count) -batch $(benchmark.batch) -package github.com/mailru/easyjson \
		1> $(benchmark.github.com.mailru.easyjson).txt \
		2> $(benchmark.github.com.mailru.easyjson).log

$(benchmark.github.com.protobuf.v1).txt: $(benchmark.msgs) $(benchmark.bin)
	cat $(benchmark.msgs) | $(benchmark.bin) -count $(benchmark.count) -batch $(benchmark.batch) -package github.com/segmentio/protobuf/v1 \
		1> $(benchmark.github.com.protobuf.v1).txt \
		2> $(benchmark.github.com.protobuf.v1).log

$(benchmark.vmihailenco.msgpack).txt: $(benchmark.msgs) $(benchmark.bin)
	cat $(benchmark.msgs) | $(benchmark.bin) -count $(benchmark.count) -batch $(benchmark.batch) -package github.com/vmihailenco/msgpack \
		1> $(benchmark.vmihailenco.msgpack).txt \
		2> $(benchmark.vmihailenco.msgpack).log

$(benchmark.tinylib.msgp).txt: $(benchmark.msgs) $(benchmark.bin)
	cat $(benchmark.msgs) | $(benchmark.bin) -count $(benchmark.count) -batch $(benchmark.batch) -package github.com/tinylib/msgp \
		1> $(benchmark.tinylib.msgp).txt \
		2> $(benchmark.tinylib.msgp).log

$(benchmark.encoding.json.gzip).txt: $(benchmark.msgs) $(benchmark.bin)
	cat $(benchmark.msgs) | $(benchmark.bin) -count $(benchmark.count) -batch $(benchmark.batch) -package encoding/json -compression gzip \
		1> $(benchmark.encoding.json.gzip).txt \
		2> $(benchmark.encoding.json.gzip).log

$(benchmark.github.com.json-iterator.go.gzip).txt: $(benchmark.msgs) $(benchmark.bin)
	cat $(benchmark.msgs) | $(benchmark.bin) -count $(benchmark.count) -batch $(benchmark.batch) -package github.com/json-iterator/go -compression gzip \
		1> $(benchmark.github.com.json-iterator.go.gzip).txt \
		2> $(benchmark.github.com.json-iterator.go.gzip).log

$(benchmark.github.com.segmentio.encoding.json.gzip).txt: $(benchmark.msgs) $(benchmark.bin)
	cat $(benchmark.msgs) | $(benchmark.bin) -count $(benchmark.count) -batch $(benchmark.batch) -package github.com/segmentio/encoding/json -compression gzip \
		1> $(benchmark.github.com.segmentio.encoding.json.gzip).txt \
		2> $(benchmark.github.com.segmentio.encoding.json.gzip).log

$(benchmark.github.com.mailru.easyjson.gzip).txt: $(benchmark.msgs) $(benchmark.bin)
	cat $(benchmark.msgs) | $(benchmark.bin) -count $(benchmark.count) -batch $(benchmark.batch) -package github.com/mailru/easyjson -compression gzip \
		1> $(benchmark.github.com.mailru.easyjson.gzip).txt \
		2> $(benchmark.github.com.mailru.easyjson.gzip).log

$(benchmark.github.com.protobuf.v1.gzip).txt: $(benchmark.msgs) $(benchmark.bin)
	cat $(benchmark.msgs) | $(benchmark.bin) -count $(benchmark.count) -batch $(benchmark.batch) -package github.com/segmentio/protobuf/v1 -compression gzip \
		1> $(benchmark.github.com.protobuf.v1.gzip).txt \
		2> $(benchmark.github.com.protobuf.v1.gzip).log

$(benchmark.vmihailenco.msgpack.gzip).txt: $(benchmark.msgs) $(benchmark.bin)
	cat $(benchmark.msgs) | $(benchmark.bin) -count $(benchmark.count) -batch $(benchmark.batch) -package github.com/vmihailenco/msgpack -compression gzip \
		1> $(benchmark.vmihailenco.msgpack.gzip).txt \
		2> $(benchmark.vmihailenco.msgpack.gzip).log

$(benchmark.tinylib.msgp.gzip).txt: $(benchmark.msgs) $(benchmark.bin)
	cat $(benchmark.msgs) | $(benchmark.bin) -count $(benchmark.count) -batch $(benchmark.batch) -package github.com/tinylib/msgp -compression gzip \
		1> $(benchmark.tinylib.msgp.gzip).txt \
		2> $(benchmark.tinylib.msgp.gzip).log

$(benchmark.encoding.json.snappy).txt: $(benchmark.msgs) $(benchmark.bin)
	cat $(benchmark.msgs) | $(benchmark.bin) -count $(benchmark.count) -batch $(benchmark.batch) -package encoding/json -compression snappy \
		1> $(benchmark.encoding.json.snappy).txt \
		2> $(benchmark.encoding.json.snappy).log

$(benchmark.github.com.json-iterator.go.snappy).txt: $(benchmark.msgs) $(benchmark.bin)
	cat $(benchmark.msgs) | $(benchmark.bin) -count $(benchmark.count) -batch $(benchmark.batch) -package github.com/json-iterator/go -compression snappy \
		1> $(benchmark.github.com.json-iterator.go.snappy).txt \
		2> $(benchmark.github.com.json-iterator.go.snappy).log

$(benchmark.github.com.segmentio.encoding.json.snappy).txt: $(benchmark.msgs) $(benchmark.bin)
	cat $(benchmark.msgs) | $(benchmark.bin) -count $(benchmark.count) -batch $(benchmark.batch) -package github.com/segmentio/encoding/json -compression snappy \
		1> $(benchmark.github.com.segmentio.encoding.json.snappy).txt \
		2> $(benchmark.github.com.segmentio.encoding.json.snappy).log

$(benchmark.github.com.mailru.easyjson.snappy).txt: $(benchmark.msgs) $(benchmark.bin)
	cat $(benchmark.msgs) | $(benchmark.bin) -count $(benchmark.count) -batch $(benchmark.batch) -package github.com/mailru/easyjson -compression snappy \
		1> $(benchmark.github.com.mailru.easyjson.snappy).txt \
		2> $(benchmark.github.com.mailru.easyjson.snappy).log

$(benchmark.github.com.protobuf.v1.snappy).txt: $(benchmark.msgs) $(benchmark.bin)
	cat $(benchmark.msgs) | $(benchmark.bin) -count $(benchmark.count) -batch $(benchmark.batch) -package github.com/segmentio/protobuf/v1 -compression snappy \
		1> $(benchmark.github.com.protobuf.v1.snappy).txt \
		2> $(benchmark.github.com.protobuf.v1.snappy).log

$(benchmark.vmihailenco.msgpack.snappy).txt: $(benchmark.msgs) $(benchmark.bin)
	cat $(benchmark.msgs) | $(benchmark.bin) -count $(benchmark.count) -batch $(benchmark.batch) -package github.com/vmihailenco/msgpack -compression snappy \
		1> $(benchmark.vmihailenco.msgpack.snappy).txt \
		2> $(benchmark.vmihailenco.msgpack.snappy).log

$(benchmark.tinylib.msgp.snappy).txt: $(benchmark.msgs) $(benchmark.bin)
	cat $(benchmark.msgs) | $(benchmark.bin) -count $(benchmark.count) -batch $(benchmark.batch) -package github.com/tinylib/msgp -compression snappy \
		1> $(benchmark.tinylib.msgp.snappy).txt \
		2> $(benchmark.tinylib.msgp.snappy).log

$(benchmark.encoding.json.zstd).txt: $(benchmark.msgs) $(benchmark.bin)
	cat $(benchmark.msgs) | $(benchmark.bin) -count $(benchmark.count) -batch $(benchmark.batch) -package encoding/json -compression zstd \
		1> $(benchmark.encoding.json.zstd).txt \
		2> $(benchmark.encoding.json.zstd).log

$(benchmark.github.com.json-iterator.go.zstd).txt: $(benchmark.msgs) $(benchmark.bin)
	cat $(benchmark.msgs) | $(benchmark.bin) -count $(benchmark.count) -batch $(benchmark.batch) -package github.com/json-iterator/go -compression zstd \
		1> $(benchmark.github.com.json-iterator.go.zstd).txt \
		2> $(benchmark.github.com.json-iterator.go.zstd).log

$(benchmark.github.com.segmentio.encoding.json.zstd).txt: $(benchmark.msgs) $(benchmark.bin)
	cat $(benchmark.msgs) | $(benchmark.bin) -count $(benchmark.count) -batch $(benchmark.batch) -package github.com/segmentio/encoding/json -compression zstd \
		1> $(benchmark.github.com.segmentio.encoding.json.zstd).txt \
		2> $(benchmark.github.com.segmentio.encoding.json.zstd).log

$(benchmark.github.com.mailru.easyjson.zstd).txt: $(benchmark.msgs) $(benchmark.bin)
	cat $(benchmark.msgs) | $(benchmark.bin) -count $(benchmark.count) -batch $(benchmark.batch) -package github.com/mailru/easyjson -compression zstd \
		1> $(benchmark.github.com.mailru.easyjson.zstd).txt \
		2> $(benchmark.github.com.mailru.easyjson.zstd).log

$(benchmark.github.com.protobuf.v1.zstd).txt: $(benchmark.msgs) $(benchmark.bin)
	cat $(benchmark.msgs) | $(benchmark.bin) -count $(benchmark.count) -batch $(benchmark.batch) -package github.com/segmentio/protobuf/v1 -compression zstd \
		1> $(benchmark.github.com.protobuf.v1.zstd).txt \
		2> $(benchmark.github.com.protobuf.v1.zstd).log

$(benchmark.vmihailenco.msgpack.zstd).txt: $(benchmark.msgs) $(benchmark.bin)
	cat $(benchmark.msgs) | $(benchmark.bin) -count $(benchmark.count) -batch $(benchmark.batch) -package github.com/vmihailenco/msgpack -compression zstd \
		1> $(benchmark.vmihailenco.msgpack.zstd).txt \
		2> $(benchmark.vmihailenco.msgpack.zstd).log

$(benchmark.tinylib.msgp.zstd).txt: $(benchmark.msgs) $(benchmark.bin)
	cat $(benchmark.msgs) | $(benchmark.bin) -count $(benchmark.count) -batch $(benchmark.batch) -package github.com/tinylib/msgp -compression zstd \
		1> $(benchmark.tinylib.msgp.zstd).txt \
		2> $(benchmark.tinylib.msgp.zstd).log