I am trying to pinpoint a performance issue with a go package that uses a large 3rd party C++ library we interface with using CGO.
Tried these options:
1.
Go profiler -
doesn't see anything beyond function runtime.cgocall. This has already been discussed
here and as far as I understand is not going to be supported.
2. gperftools - it seems the Go runtime is interfering with the operation of gperftools in some way: When starting the program with the CPUPROFILE variable or using explicit ProfilerStart() calls, the output file gets created but nothing is written to it until the program ends. My guess is the Go runtime is somehow preventing gperftools from receiving sampling events.
3. Linux perf - this works, but requires converting the data to pprof format (using perf_data_converter) or analyzing it using another tool like hotspot.
Currently our best bet is to stick to perf. Anyone have other suggestions?
It would be awesome if Go supported profiling a mixed C/Go application with the built-in tools...