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

40 lines
746 B
Go

package main
import (
"fmt"
"testing"
"github.com/NickyBoy89/spatial-db/server"
)
var inmemory server.InMemoryServer
var inmemoryInit bool
func initInMemory() {
if !inmemoryInit {
fmt.Println("Initializing in-memory server")
inmemory.SetStorageRoot("skygrid-save")
inmemoryInit = true
}
}
func BenchmarkReadWithin128InMemory(b *testing.B) {
initInMemory()
readBlockTemplate(&inmemory, b, 128)
}
func BenchmarkReadWithin512InMemory(b *testing.B) {
initInMemory()
readBlockTemplate(&inmemory, b, 512)
}
func BenchmarkReadWithin2048InMemory(b *testing.B) {
initInMemory()
readBlockTemplate(&inmemory, b, 2048)
}
func BenchmarkReadWithin65536InMemory(b *testing.B) {
initInMemory()
readBlockTemplate(&inmemory, b, 65536)
}