Development Guide
Information for developers looking to build, test, and profile Scout.
Setup from Source
Building from source allows you to run the latest development version and customize the build.
Prerequisites
- Install Git and Golang.
Step-by-Step Installation
- Clone the repository:
git clone https://github.com/jonoton/scout.git cd scout - Download Dependencies:
go mod download - Build GoCV: Scout depends on GoCV. You may need to install the GoCV dependencies on your system:
cd $(go env GOPATH)/pkg/mod/gocv.io/x/gocv@v0.37.0 sudo make install # or install_cuda for GPU support cd - - Install Scout:
go install ./...
Running Scout
- Ensure your
.configdirectory is populated. - Run the executable from your
$GOPATH/binor the project root:scout
Profiling with GoLang
Scout supports profiling using the standard Go pprof tool.
Prerequisites
- Graphviz: Required for generating visual profile graphs.
sudo apt install graphviz
How to Profile
- Run Scout with profiling enabled:
go run -tags profile github.com/jonoton/scoutThis starts a pprof HTTP server on
localhost:6060. - Capture and View Profiles:
- CPU Profile:
go tool pprof -http localhost:8081 http://localhost:6060 - Memory Profile:
go tool pprof -http localhost:8081 http://localhost:6060/debug/pprof/heap - GoCV Mat Profile:
go run -tags matprofile github.com/jonoton/scout go tool pprof -http localhost:8081 http://localhost:6060/debug/pprof/gocv.io/x/gocv.Mat - SharedMat Profile:
go tool pprof -http localhost:8081 http://localhost:6060/debug/pprof/github.com/jonoton/go-sharedmat.counts
- CPU Profile:
- Navigate the Web UI: The
View -> Flame Graphis highly recommended for identifying bottlenecks.