Example #1
0
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()
		}
	}
}
Example #2
0
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()
		}
	}
}
Example #3
0
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()
		}
	}
}