This is a quick version to to get initial numbers, not intended to be committed
as is but can be used to analyze existing bottlenecks. The output is a bit of a
mess mixed with everything else.
A nicer version of this could extend the mechanism of render/stats.h, with the
ability to print a summary with better formatting and indentation.