Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
testing: support pausing cpu profiling in benchmarks #8213
The benchmarking part of the "testing" package supports stopping timers while performing complex initialisation. Perhaps something analogous could be added for cpu profiling, so that -cpuprofile can produce a data file that excludes samples for the complex initialisation. The current workaround is to avoid -cpuprofile in favour of calling runtime.StartCPUProfile from within the benchmark.