// Copyright (C) 2019 Marius Schellenberger

package store

import "testing"

var g = NewGOB()

func BenchmarkGOBMarshalPage(b *testing.B) {
	b.ReportAllocs()
	for i := 0; i < b.N; i++ {
		g.Marshal(p)
	}
}

func BenchmarkGOBUnmarshalPage(b *testing.B) {
	bytes, _ := g.Marshal(p)
	var pp Page
	b.ReportAllocs()
	for i := 0; i < b.N; i++ {
		g.Unmarshal(bytes, &pp)
	}
}

func BenchmarkGOBMarshalUser(b *testing.B) {
	b.ReportAllocs()
	for i := 0; i < b.N; i++ {
		g.Marshal(u)
	}
}

func BenchmarkGOBUnmarshalUser(b *testing.B) {
	bytes, _ := g.Marshal(u)
	var uu User
	b.ReportAllocs()
	for i := 0; i < b.N; i++ {
		g.Unmarshal(bytes, &uu)
	}
}
