func BenchmarkEncodeComplexDataWithHeader(b *testing.B) { enc := sereal.NewEncoderV3() b.ResetTimer() for i := 0; i < b.N; i++ { _, err := enc.MarshalWithHeader(solarSystemMeta, solarSystem) if err != nil { b.FailNow() } } }
func BenchmarkEncodeAndZlibComplexDataWithHeader(b *testing.B) { enc := sereal.NewEncoderV3() enc.Compression = sereal.ZlibCompressor{Level: sereal.ZlibDefaultCompression} enc.CompressionThreshold = 0 b.ResetTimer() for i := 0; i < b.N; i++ { _, err := enc.MarshalWithHeader(solarSystemMeta, solarSystem) if err != nil { b.FailNow() } } }
func BenchmarkEncodeAndSnappyComplexDataWithHeader(b *testing.B) { enc := sereal.NewEncoderV3() enc.Compression = sereal.SnappyCompressor{Incremental: true} enc.CompressionThreshold = 0 b.ResetTimer() for i := 0; i < b.N; i++ { _, err := enc.MarshalWithHeader(solarSystemMeta, solarSystem) if err != nil { b.FailNow() } } }