// go test -bench=Decode
func BenchmarkDecode(b *testing.B) {
	b.StopTimer()
	length := 128 * 1024
	data := generators.GenerateClustered(length, 1<<24)
	compdata := make([]int32, 2*length)
	recov := make([]int32, length)
	inpos := cursor.New()
	outpos := cursor.New()
	codec := New()
	codec.Compress(data, inpos, len(data), compdata, outpos)
	b.StartTimer()
	for j := 0; j < b.N; j++ {
		newinpos := cursor.New()
		newoutpos := cursor.New()
		codec.Uncompress(compdata, newinpos, outpos.Get()-newinpos.Get(), recov, newoutpos)
	}
}
func init() {
	log.Printf("variablebyte/init: generating %d int32s\n", size)
	data = generators.GenerateClustered(size, size*2)
	log.Printf("variablebyte/init: generated %d integers for test", size)
}
Beispiel #3
0
func init() {
	log.Printf("composition_test/init: generating %d uint32s\n", size)
	data = generators.GenerateClustered(size, size*2)
	log.Printf("composition_test/init: generated %d integers for test", size)
}