improved performance

This commit is contained in:
2022-08-21 13:44:09 +02:00
parent 02f445f02f
commit f1e3a68dc4
2 changed files with 16 additions and 14 deletions

View File

@ -1,9 +1,10 @@
package main
import (
log "github.com/sirupsen/logrus"
"os"
"runtime/trace"
"runtime/pprof"
log "github.com/sirupsen/logrus"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obioptions"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obitools/obiconvert"
@ -13,20 +14,20 @@ import (
func main() {
// go tool pprof -http=":8000" ./obipairing ./cpu.pprof
// f, err := os.Create("cpu.pprof")
// if err != nil {
// log.Fatal(err)
// }
// pprof.StartCPUProfile(f)
// defer pprof.StopCPUProfile()
// go tool trace cpu.trace
ftrace, err := os.Create("cpu.trace")
f, err := os.Create("cpu.pprof")
if err != nil {
log.Fatal(err)
}
trace.Start(ftrace)
defer trace.Stop()
pprof.StartCPUProfile(f)
defer pprof.StopCPUProfile()
// go tool trace cpu.trace
// ftrace, err := os.Create("cpu.trace")
// if err != nil {
// log.Fatal(err)
// }
// trace.Start(ftrace)
// defer trace.Stop()
optionParser := obioptions.GenerateOptionParser(obipcr.OptionSet)

View File

@ -3,6 +3,7 @@ package obipcr
import (
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiapat"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiiter"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obioptions"
)
// PCR iterates over sequences provided by a obiseq.IBioSequenceBatch
@ -37,5 +38,5 @@ func PCR(iterator obiiter.IBioSequenceBatch) (obiiter.IBioSequenceBatch, error)
worker := obiapat.PCRSliceWorker(opts...)
return iterator.MakeISliceWorker(worker), nil
return iterator.MakeISliceWorker(worker, obioptions.CLIParallelWorkers(), 0), nil
}