Skip to content

Instantly share code, notes, and snippets.

@bilus
Created April 4, 2018 21:14
Show Gist options
  • Save bilus/92c0dee349583ac2b7d156e40de4284c to your computer and use it in GitHub Desktop.
Save bilus/92c0dee349583ac2b7d156e40de4284c to your computer and use it in GitHub Desktop.
package main
import (
"database/sql"
"github.com/bilus/fencer/primitives"
"github.com/iBiquity/conrad/delivery/go-broadcasts/store"
_ "github.com/lib/pq"
"log"
"runtime"
"time"
)
func main() {
db, err := sql.Open("postgres", "host=localhost dbname=broadcasts user=postgres password=mysecretpassword sslmode=disable")
if err != nil {
log.Fatal(err)
}
for i := 0; i < 10000; i++ {
bs, numSkipped, err := store.LoadBroadcastsFromSQL(db)
if err != nil {
log.Fatal(err)
}
runtime.GC()
for _, b := range bs {
b.Contains(primitives.Point{0, 0})
}
log.Printf("Loaded %v, skipped %v\n", len(bs), numSkipped)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment