mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2025-07-03 00:20:48 +02:00
Only do expensive area coverage calculation if there where blocks loaded from database.
If there are not, nothing changed, so nothing to recalculate. Takes a good deal from the clock.
This commit is contained in:
@ -8,6 +8,8 @@ import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"runtime/pprof"
|
||||
|
||||
"bitbucket.org/s_l_teichmann/mtsatellite/common"
|
||||
)
|
||||
@ -27,6 +29,7 @@ func main() {
|
||||
transparent bool
|
||||
transparentDim float64
|
||||
version bool
|
||||
cpuProfile string
|
||||
)
|
||||
|
||||
defaultBgColor := common.ColorToHex(common.BackgroundColor)
|
||||
@ -60,6 +63,7 @@ func main() {
|
||||
"td", common.DefaultTransparentDim*100.0,
|
||||
"Extra fimming of transparent nodes each depth meter in percent. (shorthand)")
|
||||
flag.BoolVar(&version, "version", false, "Print version and exit.")
|
||||
flag.StringVar(&cpuProfile, "c", "", "Dump pprof profile to file.")
|
||||
|
||||
flag.Parse()
|
||||
|
||||
@ -67,6 +71,15 @@ func main() {
|
||||
common.PrintVersionAndExit()
|
||||
}
|
||||
|
||||
if cpuProfile != "" {
|
||||
f, err := os.Create(cpuProfile)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
pprof.StartCPUProfile(f)
|
||||
defer pprof.StopCPUProfile()
|
||||
}
|
||||
|
||||
bg := common.ParseColorDefault(bgColor, common.BackgroundColor)
|
||||
|
||||
if !skipBaseLevel {
|
||||
|
Reference in New Issue
Block a user