Beispiel #1
0
func BenchmarkMarshalByGoMemdump(b *testing.B) {
	var buf bytes.Buffer
	//w := bufio.NewWriter(&buf)

	for i := 0; i < b.N; i++ {
		memdump.Encode(&buf, &group)
	}
}
Beispiel #2
0
func BenchmarkUnmarshalByGoMemdump(b *testing.B) {
	result := &ColorGroup{}

	var buf bytes.Buffer
	memdump.Encode(&buf, &group)

	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		memdump.Decode(&buf, &result)
	}
}