Skip to content

nazarifard/go_serialization_benchmarks

 
 

Repository files navigation

Benchmarks of Go serialization methods

Gitter chat

This is a test suite for benchmarking various Go serialization methods.

Current Serialization Results

https://alecthomas.github.io/go_serialization_benchmarks

Running the benchmarks

go test -bench=.

To validate the correctness of the serializers:

VALIDATE=1 go test -bench=. -benchtime=1ms

To update the benchmark report:

go test -tags genreport -run TestGenerateReport

Recommendation

If correctness and interoperability are the most important factors JSON or Protobuf are your best options.

But as always, make your own choice based on your requirements.

Data

The data being serialized is the following structure with randomly generated values:

type A struct {
    Name     string
    BirthDay time.Time
    Phone    string
    Siblings int
    Spouse   bool
    Money    float64
}

Releases

No releases published

Packages

No packages published

Languages

  • Go 63.1%
  • JavaScript 22.6%
  • CSS 5.5%
  • HTML 3.9%
  • Makefile 3.1%
  • Shell 1.5%
  • Cap'n Proto 0.3%