Skip to content

Commit 75c9233

Browse files
committed
Merge pull request alecthomas#46 from FiloSottile/master
Switch gogo to the documented gogofaster mode
2 parents 1360794 + 52f209b commit 75c9233

File tree

3 files changed

+50
-59
lines changed

3 files changed

+50
-59
lines changed

Makefile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ msgp_gen.go: structdef.go
1010
go generate
1111

1212
structdef-gogo.pb.go: structdef-gogo.proto
13-
protoc --gogo_out=. -I. -I${GOPATH}/src -I${GOPATH}/src/github.com/gogo/protobuf/protobuf structdef-gogo.proto
13+
protoc --gogofaster_out=. -I. -I${GOPATH}/src -I${GOPATH}/src/github.com/gogo/protobuf/protobuf structdef-gogo.proto
1414

1515
structdef.pb.go: structdef.proto
1616
protoc --go_out=. structdef.proto
@@ -19,15 +19,14 @@ vitess_test.go: structdef.go
1919
bsongen -file=structdef.go -o=vitess_test.go -type=A
2020

2121
structdef.capnp2.go: structdef.capnp2
22-
go get -u zombiezen.com/go/capnproto2/...
22+
go get -u zombiezen.com/go/capnproto2/... # conflicts with go-capnproto
2323
capnp compile -I${GOPATH}/src -ogo structdef.capnp2
2424

2525
structdef.capnp.go: structdef.capnp
26-
go get -u github.com/glycerine/go-capnproto/capnpc-go
26+
go get -u github.com/glycerine/go-capnproto/capnpc-go # conflicts with capnproto2
2727
capnp compile -I${GOPATH}/src -ogo structdef.capnp
2828

2929
gencode.schema.gen.go: gencode.schema
30-
go get -u github.com/andyleap/gencode
3130
gencode go -schema=gencode.schema -package=goserbench
3231

3332
.PHONY: clean
@@ -36,7 +35,7 @@ clean:
3635

3736
.PHONY: install
3837
install:
39-
go get -u github.com/gogo/protobuf/protoc-gen-gogo
38+
go get -u github.com/gogo/protobuf/protoc-gen-gogofaster
4039
go get -u github.com/gogo/protobuf/gogoproto
4140
go get -u github.com/golang/protobuf/protoc-gen-go
4241
go get -u github.com/tinylib/msgp

README.md

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -63,49 +63,49 @@ type A struct {
6363

6464
## Results
6565

66-
Results with Go 1.5 on a 2.6 GHz Intel Core i7 (MacBook Pro 15"):
66+
Results with Go 1.5.3 on a 2.2 GHz Intel Core i7 (MacBook Pro 15"):
6767

6868
```
6969
benchmark iter time/iter bytes alloc allocs
7070
--------- ---- --------- ----------- ------
71-
BenchmarkMsgpMarshal-8 5000000 240 ns/op 128 B/op 1 allocs/op
72-
BenchmarkMsgpUnmarshal-8 3000000 444 ns/op 112 B/op 3 allocs/op
73-
BenchmarkVmihailencoMsgpackMarshal-8 1000000 2331 ns/op 400 B/op 6 allocs/op
74-
BenchmarkVmihailencoMsgpackUnmarshal-8 1000000 2038 ns/op 400 B/op 13 allocs/op
75-
BenchmarkJsonMarshal-8 500000 2657 ns/op 584 B/op 7 allocs/op
76-
BenchmarkJsonUnmarshal-8 300000 4241 ns/op 463 B/op 8 allocs/op
77-
BenchmarkBsonMarshal-8 1000000 1816 ns/op 416 B/op 10 allocs/op
78-
BenchmarkBsonUnmarshal-8 1000000 2240 ns/op 416 B/op 21 allocs/op
79-
BenchmarkVitessBsonMarshal-8 1000000 1085 ns/op 1168 B/op 4 allocs/op
80-
BenchmarkVitessBsonUnmarshal-8 2000000 808 ns/op 224 B/op 4 allocs/op
81-
BenchmarkGobMarshal-8 1000000 1095 ns/op 48 B/op 2 allocs/op
82-
BenchmarkGobUnmarshal-8 1000000 1231 ns/op 160 B/op 6 allocs/op
83-
BenchmarkXdrMarshal-8 1000000 2068 ns/op 591 B/op 20 allocs/op
84-
BenchmarkXdrUnmarshal-8 1000000 1583 ns/op 287 B/op 11 allocs/op
85-
BenchmarkUgorjiCodecMsgpackMarshal-8 500000 2832 ns/op 2721 B/op 8 allocs/op
86-
BenchmarkUgorjiCodecMsgpackUnmarshal-8 500000 3225 ns/op 3104 B/op 12 allocs/op
87-
BenchmarkUgorjiCodecBincMarshal-8 500000 2838 ns/op 2753 B/op 8 allocs/op
88-
BenchmarkUgorjiCodecBincUnmarshal-8 500000 3401 ns/op 3264 B/op 15 allocs/op
89-
BenchmarkSerealMarshal-8 500000 4048 ns/op 928 B/op 21 allocs/op
90-
BenchmarkSerealUnmarshal-8 500000 3801 ns/op 1152 B/op 34 allocs/op
91-
BenchmarkBinaryMarshal-8 1000000 1792 ns/op 352 B/op 16 allocs/op
92-
BenchmarkBinaryUnmarshal-8 1000000 1876 ns/op 448 B/op 22 allocs/op
93-
BenchmarkFlatbuffersMarshal-8 5000000 363 ns/op 0 B/op 0 allocs/op
94-
BenchmarkFlatBuffersUnmarshal-8 5000000 315 ns/op 112 B/op 3 allocs/op
95-
BenchmarkCapNProtoMarshal-8 3000000 511 ns/op 64 B/op 2 allocs/op
96-
BenchmarkCapNProtoUnmarshal-8 3000000 461 ns/op 216 B/op 6 allocs/op
97-
BenchmarkCapNProto2Marshal-8 1000000 1709 ns/op 608 B/op 15 allocs/op
98-
BenchmarkCapNProto2Unmarshal-8 1000000 1669 ns/op 640 B/op 16 allocs/op
99-
BenchmarkHproseMarshal-8 1000000 1103 ns/op 494 B/op 8 allocs/op
100-
BenchmarkHproseUnmarshal-8 1000000 1323 ns/op 320 B/op 10 allocs/op
101-
BenchmarkProtobufMarshal-8 1000000 1322 ns/op 224 B/op 7 allocs/op
102-
BenchmarkProtobufUnmarshal-8 2000000 913 ns/op 240 B/op 10 allocs/op
103-
BenchmarkGoprotobufMarshal-8 2000000 672 ns/op 320 B/op 4 allocs/op
104-
BenchmarkGoprotobufUnmarshal-8 2000000 911 ns/op 432 B/op 9 allocs/op
105-
BenchmarkGogoprotobufMarshal-8 10000000 183 ns/op 64 B/op 1 allocs/op
106-
BenchmarkGogoprotobufUnmarshal-8 5000000 290 ns/op 112 B/op 3 allocs/op
107-
BenchmarkGencodeMarshal-8 10000000 187 ns/op 80 B/op 2 allocs/op
108-
BenchmarkGencodeUnmarshal-8 5000000 235 ns/op 112 B/op 3 allocs/op
71+
BenchmarkMsgpMarshal-8 5000000 277 ns/op 128 B/op 1 allocs/op
72+
BenchmarkMsgpUnmarshal-8 3000000 514 ns/op 112 B/op 3 allocs/op
73+
BenchmarkVmihailencoMsgpackMarshal-8 1000000 1760 ns/op 352 B/op 5 allocs/op
74+
BenchmarkVmihailencoMsgpackUnmarshal-8 500000 2478 ns/op 400 B/op 13 allocs/op
75+
BenchmarkJsonMarshal-8 500000 3063 ns/op 536 B/op 7 allocs/op
76+
BenchmarkJsonUnmarshal-8 300000 4876 ns/op 447 B/op 8 allocs/op
77+
BenchmarkBsonMarshal-8 1000000 1970 ns/op 416 B/op 10 allocs/op
78+
BenchmarkBsonUnmarshal-8 500000 2608 ns/op 416 B/op 21 allocs/op
79+
BenchmarkVitessBsonMarshal-8 1000000 1220 ns/op 1168 B/op 4 allocs/op
80+
BenchmarkVitessBsonUnmarshal-8 2000000 946 ns/op 224 B/op 4 allocs/op
81+
BenchmarkGobMarshal-8 1000000 1254 ns/op 48 B/op 2 allocs/op
82+
BenchmarkGobUnmarshal-8 1000000 1450 ns/op 160 B/op 6 allocs/op
83+
BenchmarkXdrMarshal-8 1000000 2256 ns/op 527 B/op 19 allocs/op
84+
BenchmarkXdrUnmarshal-8 1000000 1798 ns/op 272 B/op 11 allocs/op
85+
BenchmarkUgorjiCodecMsgpackMarshal-8 500000 3235 ns/op 2721 B/op 8 allocs/op
86+
BenchmarkUgorjiCodecMsgpackUnmarshal-8 500000 3600 ns/op 3104 B/op 12 allocs/op
87+
BenchmarkUgorjiCodecBincMarshal-8 500000 3274 ns/op 2753 B/op 8 allocs/op
88+
BenchmarkUgorjiCodecBincUnmarshal-8 500000 3650 ns/op 3120 B/op 12 allocs/op
89+
BenchmarkSerealMarshal-8 300000 4564 ns/op 928 B/op 21 allocs/op
90+
BenchmarkSerealUnmarshal-8 300000 4550 ns/op 1152 B/op 34 allocs/op
91+
BenchmarkBinaryMarshal-8 1000000 1967 ns/op 352 B/op 16 allocs/op
92+
BenchmarkBinaryUnmarshal-8 1000000 2109 ns/op 448 B/op 22 allocs/op
93+
BenchmarkFlatbuffersMarshal-8 3000000 411 ns/op 0 B/op 0 allocs/op
94+
BenchmarkFlatBuffersUnmarshal-8 5000000 366 ns/op 112 B/op 3 allocs/op
95+
BenchmarkCapNProtoMarshal-8 2000000 594 ns/op 64 B/op 2 allocs/op
96+
BenchmarkCapNProtoUnmarshal-8 3000000 535 ns/op 216 B/op 6 allocs/op
97+
BenchmarkCapNProto2Marshal-8 1000000 2054 ns/op 608 B/op 15 allocs/op
98+
BenchmarkCapNProto2Unmarshal-8 1000000 1943 ns/op 640 B/op 16 allocs/op
99+
BenchmarkHproseMarshal-8 1000000 1308 ns/op 489 B/op 8 allocs/op
100+
BenchmarkHproseUnmarshal-8 1000000 1506 ns/op 320 B/op 10 allocs/op
101+
BenchmarkProtobufMarshal-8 1000000 1361 ns/op 224 B/op 7 allocs/op
102+
BenchmarkProtobufUnmarshal-8 1000000 1072 ns/op 240 B/op 10 allocs/op
103+
BenchmarkGoprotobufMarshal-8 2000000 764 ns/op 320 B/op 4 allocs/op
104+
BenchmarkGoprotobufUnmarshal-8 1000000 1044 ns/op 432 B/op 9 allocs/op
105+
BenchmarkGogoprotobufMarshal-8 10000000 214 ns/op 64 B/op 1 allocs/op
106+
BenchmarkGogoprotobufUnmarshal-8 5000000 306 ns/op 96 B/op 3 allocs/op
107+
BenchmarkGencodeMarshal-8 10000000 217 ns/op 80 B/op 2 allocs/op
108+
BenchmarkGencodeUnmarshal-8 5000000 266 ns/op 112 B/op 3 allocs/op
109109
```
110110

111111
## Issues

structdef-gogo.pb.go

Lines changed: 7 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)