diff --git a/pmtiles/makesync.go b/pmtiles/makesync.go index 8236cbe..f383f0d 100644 --- a/pmtiles/makesync.go +++ b/pmtiles/makesync.go @@ -14,6 +14,7 @@ import ( "log" "os" "runtime" + "runtime/pprof" "strconv" "strings" "time" @@ -38,6 +39,13 @@ type Syncline struct { } func Makesync(logger *log.Logger, cli_version string, file string, block_size_kb int, checksum string) error { + f, err := os.Create("makesync.profile") + if err != nil { + log.Fatal("could not create CPU profile: ", err) + } + defer f.Close() + pprof.StartCPUProfile(f) + defer pprof.StopCPUProfile() ctx := context.Background() start := time.Now()