Created
April 4, 2018 21:14
-
-
Save bilus/92c0dee349583ac2b7d156e40de4284c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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