Add Profiling Hook to Criterion Benchmarks
oojo12 opened this issue · comments
Per #254 and #262 we can get ahead of these issues and any optimization related ones by adding a profiling hook to our benchmarks. This is a feature that Criterion supports. Additionally, the profiler will only be run when running with the --profile-time
flag. I also found this post on how to do so with pprof. Pprof also produces flamegraphs if that is of interest.
I've use cargo-flamegraph
with Criterion
before but the command was pretty involved. Using hooks makes this significantly less bothersome so I'm all for it. pprof
is a good choice because it supports flamegraphs, which we should definitely generate. Note that the post you linked is a bit outdated, and the pprof
docs actually have a simpler way of interfacing with Criterion and producing a flamegraph.
sounds grand. I'll look into this later after trying to wrap up the target naming PR.
Er actually, I'll go ahead and do this one and get back to the target naming PR later.