2023-12-10 21:46:15 -08:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"testing"
|
|
|
|
|
2023-12-13 23:48:53 -08:00
|
|
|
"github.com/NickyBoy89/spatial-db/server"
|
2023-12-10 21:46:15 -08:00
|
|
|
)
|
|
|
|
|
|
|
|
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)
|
|
|
|
}
|