Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/abstractbreazy/benchmark-grpc-protobuf-vs-fasthttp-json
A simple benchmark comparing gRPC->Protobuf and JSON->fasthttp in Go.
https://github.com/abstractbreazy/benchmark-grpc-protobuf-vs-fasthttp-json
fasthttp go grpc grpc-go
Last synced: 21 days ago
JSON representation
A simple benchmark comparing gRPC->Protobuf and JSON->fasthttp in Go.
- Host: GitHub
- URL: https://github.com/abstractbreazy/benchmark-grpc-protobuf-vs-fasthttp-json
- Owner: abstractbreazy
- Created: 2022-05-31T16:56:26.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-06-04T14:14:52.000Z (over 2 years ago)
- Last Synced: 2024-06-20T13:31:57.731Z (7 months ago)
- Topics: fasthttp, go, grpc, grpc-go
- Language: Go
- Homepage:
- Size: 33.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### gRPC-Protobuf vs fastHTTP-JSON Benchmark
### ***Run tests***
Run benchmarks:
```bash
go test ./test -v -bench=Benchmark -benchmem
``````bash
go test ./test -v -bench=Benchmark -benchmem -benchtime=10000x -count 5
```### ***Results***
```bash
goos: darwin
goarch: amd64
pkg: github.com/abstractbreazy/benchmark-grpc-protobuf-vs-fasthttp-json/test
cpu: Intel(R) Core(TM) i5-9300H CPU @ 2.40GHz
Benchmark_FastHTTP_JSON
Benchmark_FastHTTP_JSON-8 10000 61367 ns/op 2398 B/op 45 allocs/op
Benchmark_FastHTTP_JSON-8 10000 61126 ns/op 2403 B/op 45 allocs/op
Benchmark_FastHTTP_JSON-8 10000 61228 ns/op 2401 B/op 45 allocs/op
Benchmark_FastHTTP_JSON-8 10000 63710 ns/op 2403 B/op 45 allocs/op
Benchmark_FastHTTP_JSON-8 10000 61296 ns/op 2407 B/op 45 allocs/op
Benchmark_GRPC_Protobuf
Benchmark_GRPC_Protobuf-8 10000 27345 ns/op 9010 B/op 161 allocs/op
Benchmark_GRPC_Protobuf-8 10000 26052 ns/op 8987 B/op 161 allocs/op
Benchmark_GRPC_Protobuf-8 10000 25251 ns/op 8986 B/op 161 allocs/op
Benchmark_GRPC_Protobuf-8 10000 24900 ns/op 8985 B/op 161 allocs/op
Benchmark_GRPC_Protobuf-8 10000 24751 ns/op 8980 B/op 161 allocs/op
PASS
ok github.com/abstractbreazy/benchmark-grpc-protobuf-vs-fasthttp-json/test 6.123s
```