40 lines
681 B
Go
40 lines
681 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
|
|
"git.nicholasnovak.io/nnovak/spatial-db/server"
|
|
)
|
|
|
|
var disk server.SimpleServer
|
|
var diskInit bool
|
|
|
|
func initDisk() {
|
|
if !diskInit {
|
|
fmt.Println("Initializing disk server")
|
|
disk.SetStorageRoot("skygrid-save")
|
|
diskInit = true
|
|
}
|
|
}
|
|
|
|
func BenchmarkReadWithin128OnDisk(b *testing.B) {
|
|
initDisk()
|
|
readBlockTemplate(&disk, b, 128)
|
|
}
|
|
|
|
func BenchmarkReadWithin512OnDisk(b *testing.B) {
|
|
initDisk()
|
|
readBlockTemplate(&disk, b, 512)
|
|
}
|
|
|
|
func BenchmarkReadWithin2048OnDisk(b *testing.B) {
|
|
initDisk()
|
|
readBlockTemplate(&disk, b, 2048)
|
|
}
|
|
|
|
func BenchmarkReadWithin65536OnDisk(b *testing.B) {
|
|
initDisk()
|
|
readBlockTemplate(&disk, b, 65536)
|
|
}
|