spatial-db/hash_read_test.go
2023-12-13 23:48:53 -08:00

40 lines
685 B
Go

package main
import (
"fmt"
"testing"
"github.com/NickyBoy89/spatial-db/server"
)
var hash server.HashServer
var hashInit bool
func initHash() {
if !hashInit {
fmt.Println("Initializing hash server")
hash.SetStorageRoot("skygrid-save")
hashInit = true
}
}
func BenchmarkReadWithin128Hashtable(b *testing.B) {
initHash()
readBlockTemplate(&hash, b, 128)
}
func BenchmarkReadWithin512Hashtable(b *testing.B) {
initHash()
readBlockTemplate(&hash, b, 512)
}
func BenchmarkReadWithin2048Hashtable(b *testing.B) {
initHash()
readBlockTemplate(&hash, b, 2048)
}
func BenchmarkReadWithin65536Hashtable(b *testing.B) {
initHash()
readBlockTemplate(&hash, b, 65536)
}