michelaquino / protobuffer-json-comparison

Comparison between Protocol Buffer and JSON

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

protobuffer-json-comparison

Comparison betewwen Protocol Buffer and JSON

Dependencies

Compile proto files

Following the instructions here to install the Protocol Buffer compiler and the Go protocol buffers plugin

To build the .proto files:

make compile-proto-files

Run

With docker

make run-as-docker

Without docker

Need redis runnning locally

Download dependencies:

make setup

Running:

make run

Endpoints

  • /proto
  • /json
  • /protojson

GET

curl http://localhost:8888/<endpoint>

POST

curl -X POST http://localhost:8888/<endpoint>

Example

curl http://localhost:8888/proto
curl -X POST http://localhost:8888/proto

Benchmark Tests

make benchmark-test

Performance tests with WRK

POST method

make wrk-post endpoint=<endpoint>

GET method

make wrk-get endpoint=<endpoint>

Example

make wrk-post endpoint=proto
make wrk-get endpoint=proto

Referencies

About

Comparison between Protocol Buffer and JSON

License:GNU General Public License v3.0


Languages

Language:Go 81.1%Language:Dockerfile 9.9%Language:Makefile 7.1%Language:Shell 1.7%Language:Lua 0.2%