Skip to content

Commit 55c6db3

Browse files
authored
Merge pull request #40 from loopholelabs/staging
Updating Master
2 parents 9b9a3d0 + 70db268 commit 55c6db3

34 files changed

+3760
-551
lines changed

.github/workflows/benchmarks.yaml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Benchmarks
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
vtproto-golang:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@v3
11+
- name: Install Go
12+
uses: actions/setup-go@v4
13+
with:
14+
go-version: "1.21"
15+
check-latest: true
16+
cache: true
17+
- name: Run Benchmarks
18+
run: make benchmark-polyglot
19+
working-directory: benchmarks

CHANGELOG.md

+24-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,25 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88
## [Unreleased]
99

10+
## [v1.2.2] - 2024-03-26
11+
12+
### Fixes
13+
14+
- Fixed a bug in Polyglot Go where the capacity of the buffer would not grow properly resulting in silent short writes and corrupted data
15+
16+
## [v1.2.1] - 2024-03-12
17+
18+
### Changes
19+
20+
- Made Buffer.Grow() in the Polyglot Go library public
21+
22+
## [v1.2.0] - 2024-03-14
23+
24+
### Changes
25+
26+
- Updated the names of error values in Go to fit with Go's standard code-style conventions
27+
- Significant performance improvements for the Golang implementation
28+
1029
## [v1.1.4] - 2023-10-12
1130

1231
### Fixes
@@ -45,9 +64,12 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
4564

4665
- Merging Typescript, Golang, and Rust implementations into a single repository
4766

48-
[unreleased]: https://github.com/loopholelabs/scale/compare/v1.1.4...HEAD
67+
[unreleased]: https://github.com/loopholelabs/scale/compare/v1.2.2...HEAD
68+
[v1.2.2]: https://github.com/loopholelabs/scale/compare/v1.2.2
69+
[v1.2.1]: https://github.com/loopholelabs/scale/compare/v1.2.1
70+
[v1.2.0]: https://github.com/loopholelabs/scale/compare/v1.2.0
4971
[v1.1.4]: https://github.com/loopholelabs/scale/compare/v1.1.4
5072
[v1.1.3]: https://github.com/loopholelabs/scale/compare/v1.1.3
5173
[v1.1.2]: https://github.com/loopholelabs/scale/compare/v1.1.2
5274
[v1.1.1]: https://github.com/loopholelabs/scale/compare/v1.1.1
53-
[v1.1.0]: https://github.com/loopholelabs/scale/compare/v1.1.0
75+
[v1.1.0]: https://github.com/loopholelabs/scale/compare/v1.1.0

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "polyglot_rs"
3-
version = "1.1.4"
3+
version = "1.2.2"
44
edition = "2021"
55
description="A high-performance serialization framework used for encoding and decoding arbitrary datastructures across languages."
66
license = "Apache-2.0"

benchmarks/Makefile

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
BENCHCOUNT ?= 10
2+
3+
install:
4+
- go install ../protoc-gen-go-polyglot
5+
- go install github.com/planetscale/vtprotobuf/cmd/protoc-gen-go-vtproto@latest
6+
- go install google.golang.org/protobuf/cmd/[email protected]
7+
8+
generate:
9+
- mkdir -p polyglot
10+
- protoc --go-polyglot_out=polyglot bench.proto
11+
- mkdir -p vtproto
12+
- protoc --go_out=vtproto --go-vtproto_out=vtproto bench.proto
13+
14+
benchmark-polyglot: benchmark-polyglot-cmp
15+
- go run -mod=mod golang.org/x/perf/cmd/benchstat bench.txt
16+
- go mod tidy
17+
- rm -rf bench.txt
18+
19+
benchmark-polyglot-cmp:
20+
- go test -bench=. -timeout=24h -count=$(BENCHCOUNT) ./... -test.short | tee bench.txt
21+
22+
benchmark-polyglot-long:
23+
- go test -bench=. -timeout=24h -count=$(BENCHCOUNT) ./... | tee bench.txt
24+
- go run -mod=mod golang.org/x/perf/cmd/benchstat bench.txt
25+
- go mod tidy
26+
- rm -rf bench.txt
27+
28+
benchmark-vtproto: benchmark-vtproto-cmp
29+
- go run -mod=mod golang.org/x/perf/cmd/benchstat bench.txt
30+
- go mod tidy
31+
- rm -rf bench.txt
32+
33+
benchmark-vtproto-cmp:
34+
- go test -bench=. -timeout=24h -count=$(BENCHCOUNT) ./... -tags=vtproto -test.short | tee bench.txt
35+
36+
benchmark-vtproto-long:
37+
- go test -bench=. -timeout=24h -count=$(BENCHCOUNT) ./... -tags=vtproto | tee bench.txt
38+
- go run -mod=mod golang.org/x/perf/cmd/benchstat bench.txt
39+
- go mod tidy
40+
- rm -rf bench.txt
41+
42+
leaks:
43+
- go test -bench=. -gcflags="-m=2" ./...

benchmarks/bench.proto

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
syntax = "proto3";
2+
3+
option go_package = "./benchmark";
4+
5+
message BytesData {
6+
bytes bytes = 1;
7+
}
8+
9+
message I32Data {
10+
int32 i32 = 1;
11+
}
12+
13+
message U32Data {
14+
uint32 u32 = 1;
15+
}
16+
17+
message I64Data {
18+
int64 i64 = 1;
19+
}
20+
21+
message U64Data {
22+
uint64 u64 = 1;
23+
}
24+
25+
service Benchmark {}

benchmarks/go.mod

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
module benchmark
2+
3+
go 1.20
4+
5+
replace github.com/loopholelabs/polyglot => ../
6+
7+
require (
8+
github.com/loopholelabs/polyglot v1.2.2
9+
google.golang.org/grpc v1.59.0
10+
google.golang.org/protobuf v1.33.0
11+
)
12+
13+
require (
14+
github.com/golang/protobuf v1.5.3 // indirect
15+
golang.org/x/net v0.17.0 // indirect
16+
golang.org/x/sys v0.13.0 // indirect
17+
golang.org/x/text v0.13.0 // indirect; indirect..
18+
google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b // indirect
19+
)

benchmarks/go.sum

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
2+
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
3+
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
4+
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
5+
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
6+
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
7+
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
8+
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
9+
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
10+
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
11+
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
12+
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
13+
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
14+
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
15+
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
16+
google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b h1:ZlWIi1wSK56/8hn4QcBp/j9M7Gt3U/3hZw3mC7vDICo=
17+
google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:swOH3j0KzcDDgGUWr+SNpyTen5YrXjS3eyPzFYKc6lc=
18+
google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk=
19+
google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98=
20+
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
21+
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
22+
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
23+
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
24+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=

0 commit comments

Comments
 (0)