Comment profiling code

This commit is contained in:
2023-01-31 22:39:34 +01:00
parent e5835310cc
commit fa6853fca1
7 changed files with 42 additions and 62 deletions

View File

@ -2,9 +2,6 @@ package main
import ( import (
"os" "os"
"runtime/pprof"
log "github.com/sirupsen/logrus"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obioptions" "git.metabarcoding.org/lecasofts/go/obitools/pkg/obioptions"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq" "git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
@ -17,12 +14,12 @@ func main() {
defer obiseq.LogBioSeqStatus() defer obiseq.LogBioSeqStatus()
// go tool pprof -http=":8000" ./obipairing ./cpu.pprof // go tool pprof -http=":8000" ./obipairing ./cpu.pprof
f, err := os.Create("cpu.pprof") // f, err := os.Create("cpu.pprof")
if err != nil { // if err != nil {
log.Fatal(err) // log.Fatal(err)
} // }
pprof.StartCPUProfile(f) // pprof.StartCPUProfile(f)
defer pprof.StopCPUProfile() // defer pprof.StopCPUProfile()
// go tool trace cpu.trace // go tool trace cpu.trace
// ftrace, err := os.Create("cpu.trace") // ftrace, err := os.Create("cpu.trace")

View File

@ -2,9 +2,6 @@ package main
import ( import (
"os" "os"
"runtime/pprof"
log "github.com/sirupsen/logrus"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obioptions" "git.metabarcoding.org/lecasofts/go/obitools/pkg/obioptions"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq" "git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
@ -17,12 +14,12 @@ func main() {
defer obiseq.LogBioSeqStatus() defer obiseq.LogBioSeqStatus()
// go tool pprof -http=":8000" ./obipairing ./cpu.pprof // go tool pprof -http=":8000" ./obipairing ./cpu.pprof
f, err := os.Create("cpu.pprof") // f, err := os.Create("cpu.pprof")
if err != nil { // if err != nil {
log.Fatal(err) // log.Fatal(err)
} // }
pprof.StartCPUProfile(f) // pprof.StartCPUProfile(f)
defer pprof.StopCPUProfile() // defer pprof.StopCPUProfile()
// go tool trace cpu.trace // go tool trace cpu.trace
// ftrace, err := os.Create("cpu.trace") // ftrace, err := os.Create("cpu.trace")

View File

@ -2,9 +2,6 @@ package main
import ( import (
"os" "os"
"runtime/pprof"
log "github.com/sirupsen/logrus"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obioptions" "git.metabarcoding.org/lecasofts/go/obitools/pkg/obioptions"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obitools/obiconvert" "git.metabarcoding.org/lecasofts/go/obitools/pkg/obitools/obiconvert"
@ -13,12 +10,12 @@ import (
func main() { func main() {
f, err := os.Create("cpu.pprof") // f, err := os.Create("cpu.pprof")
if err != nil { // if err != nil {
log.Fatal(err) // log.Fatal(err)
} // }
pprof.StartCPUProfile(f) // pprof.StartCPUProfile(f)
defer pprof.StopCPUProfile() // defer pprof.StopCPUProfile()
// ftrace, err := os.Create("cpu.trace") // ftrace, err := os.Create("cpu.trace")
// if err != nil { // if err != nil {

View File

@ -2,9 +2,6 @@ package main
import ( import (
"os" "os"
"runtime/trace"
log "github.com/sirupsen/logrus"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obioptions" "git.metabarcoding.org/lecasofts/go/obitools/pkg/obioptions"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obitools/obiconvert" "git.metabarcoding.org/lecasofts/go/obitools/pkg/obitools/obiconvert"
@ -22,12 +19,12 @@ func main() {
// defer pprof.StopCPUProfile() // defer pprof.StopCPUProfile()
// go tool trace cpu.trace // go tool trace cpu.trace
ftrace, err := os.Create("cpu.trace") // ftrace, err := os.Create("cpu.trace")
if err != nil { // if err != nil {
log.Fatal(err) // log.Fatal(err)
} // }
trace.Start(ftrace) // trace.Start(ftrace)
defer trace.Stop() // defer trace.Stop()
optionParser := obioptions.GenerateOptionParser(obipairing.OptionSet) optionParser := obioptions.GenerateOptionParser(obipairing.OptionSet)

View File

@ -2,9 +2,6 @@ package main
import ( import (
"os" "os"
"runtime/pprof"
log "github.com/sirupsen/logrus"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obioptions" "git.metabarcoding.org/lecasofts/go/obitools/pkg/obioptions"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obitools/obiconvert" "git.metabarcoding.org/lecasofts/go/obitools/pkg/obitools/obiconvert"
@ -14,12 +11,12 @@ import (
func main() { func main() {
// go tool pprof -http=":8000" ./obipairing ./cpu.pprof // go tool pprof -http=":8000" ./obipairing ./cpu.pprof
f, err := os.Create("cpu.pprof") // f, err := os.Create("cpu.pprof")
if err != nil { // if err != nil {
log.Fatal(err) // log.Fatal(err)
} // }
pprof.StartCPUProfile(f) // pprof.StartCPUProfile(f)
defer pprof.StopCPUProfile() // defer pprof.StopCPUProfile()
// go tool trace cpu.trace // go tool trace cpu.trace
// ftrace, err := os.Create("cpu.trace") // ftrace, err := os.Create("cpu.trace")

View File

@ -2,9 +2,7 @@ package main
import ( import (
"fmt" "fmt"
"log"
"os" "os"
"runtime/pprof"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obitools/obiconvert" "git.metabarcoding.org/lecasofts/go/obitools/pkg/obitools/obiconvert"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obitools/obitag" "git.metabarcoding.org/lecasofts/go/obitools/pkg/obitools/obitag"
@ -15,12 +13,12 @@ import (
func main() { func main() {
// go tool pprof -http=":8000" ./build/obitag ./cpu.pprof // go tool pprof -http=":8000" ./build/obitag ./cpu.pprof
f, err := os.Create("cpu.pprof") // f, err := os.Create("cpu.pprof")
if err != nil { // if err != nil {
log.Fatal(err) // log.Fatal(err)
} // }
pprof.StartCPUProfile(f) // pprof.StartCPUProfile(f)
defer pprof.StopCPUProfile() // defer pprof.StopCPUProfile()
// go tool trace cpu.trace // go tool trace cpu.trace
// ftrace, err := os.Create("cpu.trace") // ftrace, err := os.Create("cpu.trace")

View File

@ -2,9 +2,6 @@ package main
import ( import (
"os" "os"
"runtime/pprof"
log "github.com/sirupsen/logrus"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obioptions" "git.metabarcoding.org/lecasofts/go/obitools/pkg/obioptions"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq" "git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
@ -17,12 +14,12 @@ func main() {
defer obiseq.LogBioSeqStatus() defer obiseq.LogBioSeqStatus()
// go tool pprof -http=":8000" ./obipairing ./cpu.pprof // go tool pprof -http=":8000" ./obipairing ./cpu.pprof
f, err := os.Create("cpu.pprof") // f, err := os.Create("cpu.pprof")
if err != nil { // if err != nil {
log.Fatal(err) // log.Fatal(err)
} // }
pprof.StartCPUProfile(f) // pprof.StartCPUProfile(f)
defer pprof.StopCPUProfile() // defer pprof.StopCPUProfile()
// go tool trace cpu.trace // go tool trace cpu.trace
// ftrace, err := os.Create("cpu.trace") // ftrace, err := os.Create("cpu.trace")